Git Product home page Git Product logo

Comments (1)

mwouts avatar mwouts commented on June 19, 2024

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.

from nbautoexport.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.