Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documenting alternatives #55

Open
jayqi opened this issue Aug 16, 2020 · 1 comment
Open

Documenting alternatives #55

jayqi opened this issue Aug 16, 2020 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@jayqi
Copy link
Member

jayqi commented Aug 16, 2020

We should document alternative tools and provide some light discussion about differences.

Jupyter Notebook conversion / alternative formats

Jupyter code review tools

@jayqi jayqi added the documentation Improvements or additions to documentation label Aug 16, 2020
@mwouts
Copy link

mwouts commented Oct 14, 2020

Great idea! I'd be curious to see the comparison with Jupytext (which only does .py or .md exports, not .html, etc). Do you have an example of a sample review made with nbautoexport? I assume you review both the .ipynb and .py file, is that correct?

If you want to give a try at Jupytext, this local jupytext.toml (or .jupytext.toml) configuration file should have more or less the same effect as the one you describe in the README (put the file at the root of the project):

default_jupytext_formats = "notebooks///ipynb,notebooks/script///py:percent"
Click here for the corresponding pytest example
def test_nbautoexport_equivalent(tmpdir):
    cm = jupytext.TextFileContentsManager()
    cm.root_dir = str(tmpdir)

    nb_dir = tmpdir.mkdir('notebooks')
    script_dir = nb_dir.join('script')
    cfg_file = nb_dir.join(".jupytext.yml")

    nb_file = nb_dir.join("notebook.ipynb")
    py_file = script_dir.join("notebook.py")

    cfg_file.write("default_jupytext_formats: 'notebooks///ipynb,notebooks/script///py:percent'\n")

    cm.save(notebook_model(SAMPLE_NOTEBOOK), "notebooks/notebook.ipynb")
    assert nb_file.isfile()
    assert py_file.isfile()

Note that you can also use simpler configuration files like

default_jupytext_formats = "notebooks///ipynb,scripts///py:percent"

if you're OK with subfolders with the same parent, or even

default_jupytext_formats = "ipynb,py:percent"

if you're OK with having the text files in the same folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants