jupytext icon indicating copy to clipboard operation
jupytext copied to clipboard

How to best use jupytext and nbdev together?

Open mwouts opened this issue 5 years ago • 3 comments

Imagine we have two notebooks:

  • 1_def_function.ipynb that defines a function f and documents it, and exports it to a package using nbdev
  • 2_use_function.ipynb that imports f from the package generated by nbdev.

Questions:

  • Does it makes sense to use both nbdev and jupytext in such a project? What is the recommended configuration? Can one use text-notebooks only?
  • Is it easy to refactor the project? Imagine we want to refactor (rename) f in the project. Will a tool like PyCharm identify that f should be renamed in a. the notebook that defines f, b. the package generated by nbdev and c. the notebook that imports f?

Cc @eserie and @jph00.

mwouts avatar Jun 09 '20 07:06 mwouts

Hello!

I use both jupytext and nbdev heavily in my workflows, it would be great if I could use them together.

Thank you!

nchelaru avatar Feb 05 '21 12:02 nchelaru

I use both jupytext and nbdev heavily in my workflows, it would be great if I could use them together.

Sure! Just to be sure, currently you use them on different projects? Have you ever tried to use them on the same project? (Personally I tried but if I remember well I had a conflict on the README.md and main notebook...)

Also, what do you expect of the combination? Do you want to keep the .ipynb files and use paired notebooks, or just use text notebooks + nbdev?

mwouts avatar Feb 05 '21 19:02 mwouts

did you guys get any best practices out of this? I like my python notebooks in percent form, but would also like to use alot of what nbdev has to offer..

simeneide avatar Jul 08 '21 12:07 simeneide