You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First of all, thank you for creating and maintaining jupytext! I have been using it for quite some time and it has been incredibly useful. However, it seems like the changes introduced in 1.11.2 in response to #765 have broken some of my automated jupytexting scripts. The minimal setup to reproduce the problem seems to be the following:
With a directory structure
nb
├── scripts
└── test.ipynb
where scripts is a subdirectory and test.ipynb is some notebook
2. Run jupytext --set-formats "ipynb,scripts//py:percent" test.ipynb to create a paired script test.py in the scripts subdirectory.
3. Delete the notebook test.ipynb to simulate just having pulled test.py.
4. Try to recreate the notebook from the script: jupytext --to notebook --output test.ipynb ./scripts/test.py
Result: the notebook is correctly created but the call still fails with:
[jupytext] Reading ./scripts/test.py in format py
[jupytext] Writing test.ipynb
Traceback (most recent call last):
File "/usr/local/bin/jupytext", line 8, in <module>
sys.exit(jupytext())
File "/usr/local/lib/python3.7/site-packages/jupytext/cli.py", line 427, in jupytext
exit_code += jupytext_single_file(nb_file, args, log)
File "/usr/local/lib/python3.7/site-packages/jupytext/cli.py", line 826, in jupytext_single_file
for alt_path, _ in paired_paths(nb_file, fmt, formats)
File "/usr/local/lib/python3.7/site-packages/jupytext/paired_paths.py", line 248, in paired_paths
short_form_multiple_formats(formats),
jupytext.paired_paths.InconsistentPath: Paired paths './scripts/test.ipynb','./scripts/scripts/test.py' do not include the current notebook path './scripts/test.py'. Current format is 'py:percent', and paired formats are 'ipynb,scripts//py:percent'.
The text was updated successfully, but these errors were encountered:
MPKonst
changed the title
juptext --to notebook call from a paired script fails with InconsistentPath
jupytext --to notebook call from a paired script fails with InconsistentPath
Jun 18, 2021
Thank you @MPKonst for reporting this!
Sorry for the regression - I'll size the opportunity to add one more test and make sure we get our use case covered.
I have the same issue. I have started using 1.11.3 from 1.9.1 when I wanted to use --use-source-timestamp in my project.
I tried this following command with --output and this still fails.
jupytext --output notebooks/02-00-probe-temperature.ipynb markdown/02-00-probe-temperature.md
[jupytext] Reading markdown/02-00-probe-temperature.md in format md
[jupytext] Writing notebooks/02-00-probe-temperature.ipynb (destination file replaced [use --update to preserve cell outputs and ids])
Traceback (most recent call last):
File "C:\tools\Anaconda3\envs\sthm\Scripts\jupytext-script.py", line 9, in <module>
sys.exit(jupytext())
File "C:\tools\Anaconda3\envs\sthm\lib\site-packages\jupytext\cli.py", line 434, in jupytext
exit_code += jupytext_single_file(nb_file, args, log)
File "C:\tools\Anaconda3\envs\sthm\lib\site-packages\jupytext\cli.py", line 846, in jupytext_single_file
for alt_path, _ in paired_paths(nb_file, fmt, formats)
File "C:\tools\Anaconda3\envs\sthm\lib\site-packages\jupytext\paired_paths.py", line 248, in paired_paths
short_form_multiple_formats(formats),
jupytext.paired_paths.InconsistentPath: Paired paths 'markdown/markdown/02-00-probe-temperature.md','markdown/notebooks/02-00-probe-temperature.ipynb','markdown/scripts/02-00-probe-temperature.py' do not include the current notebook path 'markdown/02-00-probe-temperature.md'. Current format is 'md', and paired formats are 'markdown//md,notebooks//ipynb,scripts//py:percent'.
First of all, thank you for creating and maintaining jupytext! I have been using it for quite some time and it has been incredibly useful. However, it seems like the changes introduced in 1.11.2 in response to #765 have broken some of my automated jupytexting scripts. The minimal setup to reproduce the problem seems to be the following:
where scripts is a subdirectory and test.ipynb is some notebook
2. Run
jupytext --set-formats "ipynb,scripts//py:percent" test.ipynb
to create a paired scripttest.py
in thescripts
subdirectory.3. Delete the notebook
test.ipynb
to simulate just having pulledtest.py
.4. Try to recreate the notebook from the script:
jupytext --to notebook --output test.ipynb ./scripts/test.py
Result: the notebook is correctly created but the call still fails with:
The text was updated successfully, but these errors were encountered: