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

Pair ipynb with files in subfolders one level down #1144

Open
hectormz opened this issue Oct 19, 2023 · 2 comments
Open

Pair ipynb with files in subfolders one level down #1144

hectormz opened this issue Oct 19, 2023 · 2 comments

Comments

@hectormz
Copy link
Contributor

I would like to pair .ipynb files with .py files according to this structure:

.
├── jupytext.toml
├── Alpha/
│   ├── notebooks_py/
│   │   └── notebook.py
│   └── notebook.ipynb
├── Beta/
│   ├── notebooks_py/
│   │   └── notebook.py
│   └── notebook.ipynb
└── Gamma/
    ├── notebooks_py/
    │   └── notebook.py
    └── notebook.ipynb

I haven't been able to figure this out. I am able to get it to work if I switch the locations of the .ipynb and .py files and use this in in my config:

[formats]
"notebooks_ipynb/" = "ipynb"
"./" = "py:percent"

I am open to manually pairing each .py and .ipynb pair or putting jupytext.toml config files in each project directory if that will help (Alpha, Beta, Gamma)

@hectormz
Copy link
Contributor Author

I seem to be able to achieve what I want (from some other, old issues) using:

formats = "ipynb,_notebooks_py//py:percent,notebooks_md//md"

although I'm not sure what the equivalent is for the other style (for completeness)

[formats]
...
...
...
``
Maybe @mwouts has an idea. It would be good to expand the config section to cover this type of organization/pairing

@VRConservation
Copy link

Hi,
I'm having the same issue when I use

jupytext --sync *.ipynb

It only syncs the notebooks in the folder that I cd into. So, If I have paired notebooks in separate folders, I have to cd into each folder and issue the command. Is there any way to sync across an entire folder and all subfolders?

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

No branches or pull requests

2 participants