Open Siniara opened 1 year ago
Hi @Siniara I use a similar jupytext.toml
and it works fine. I'm not sure if the issue is due to using Jupyter in VS Code. I use normal Jupyter Lab that runs in my browser. I have never had to run your jupytext
command.
I believe I have always made the subfolders myself. I'm not sure jupytext
will create the subfolders in your config file.
Hey @Siniara , sorry I missed this one. Maybe you meant to use jupytext --sync
rather than --set-formats
(which sets a configuration per notebook)?
I have the same issue: the paired scripts are created in the same folder as the notebooks (jupytext 1.16.4).
The examples below are via CLI (all commands executed in the project's root folder), but I get the same result using the Jupyter web UI.
Jupytext can find the configuration file:
$ python
>>> from jupytext.config import find_jupytext_configuration_file
>>> find_jupytext_configuration_file('.')
'./pyproject.toml'
And the configuration file is as recommended in the documentation:
$ tail -n 4 pyproject.toml
[tool.jupytext.formats]
"notebooks/" = "ipynb"
"scripts/" = "py:percent"
The scripts/
folder exists.
When using Jupytext from the web UI, I created the equivalent notebooks/jupytext.toml
, so that find_jupytext_configuration_file
also works when executed from within the notebook.
Syncing does not create any new files:
$ jupytext --sync notebooks/test.ipynb
[jupytext] Reading notebooks/test.ipynb in format ipynb
[jupytext] Unchanged notebooks/test.ipynb
While manually converting creates the file in the wrong directory:
$ jupytext --to py:percent notebooks/test.ipynb
[jupytext] Reading notebooks/test.ipynb in format ipynb
[jupytext] Writing notebooks/test.py in format py:percent
And manually specifying the formats uses the wrong directory:
$ jupytext --set-formats ipynb,py notebooks/test.ipynb
[jupytext] Reading notebooks/test.ipynb in format ipynb
[jupytext] Updating notebook metadata with '{"jupytext": {"formats": "ipynb,py"}}'
[jupytext] Loading notebooks/test.py
[jupytext] Updating notebooks/test.ipynb
[jupytext] Unchanged notebooks/test.py
I have a
scripts
folder and I'd like all the paired notebooks to be in anotebooks
folder, I have ajupytext.toml
file in my project root. Just copy pasting the code from the readme has no effect.jupytext=1.15.0
My dev environment is VS Code if that might affect something. I use the jupyter extension there. The config file seems to be read as if I change the script format from
percent
tolight
it registers that change, but not the folder structure.Folder structure:
jupytext.toml
contents:then run
This creates paired notebooks in the
scripts
folder. I would have expected thenotebooks
folder to be created. I also tried creating it on my own to no effect.