-
Notifications
You must be signed in to change notification settings - Fork 386
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
Comments
I seem to be able to achieve what I want (from some other, old issues) using:
although I'm not sure what the equivalent is for the other style (for completeness)
|
Hi,
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? |
Hi @VRConservation , can you use the globstar operator for this?
@hectormz sorry that I missed this issue, indeed in the dict-like representation you can't have an empty prefix at the moment, I will fix that in a future version. |
Thanks, Marc. I'll try this. My workaround was to create a python script in the root directory that defined the folder locations as variables then ran a for loop:
```python
for folder in folders:
os.chdir(folder)
subprocess.run(["jupytext", "--sync", "*.ipynb"], check=True)
os.chdir(orig_dir)
```
Depends on `import os, subprocess` as well as defining orig_dir.
From: Marc Wouts ***@***.***>
Sent: Sunday, June 2, 2024 6:14 PM
To: mwouts/jupytext ***@***.***>
Cc: VRConservation ***@***.***>; Mention ***@***.***>
Subject: Re: [mwouts/jupytext] Pair ipynb with files in subfolders one level down (Issue #1144)
Hi @VRConservation<https://github.com/VRConservation> , can you use the globstar operator<https://askubuntu.com/questions/1010707/how-to-enable-the-double-star-globstar-operator> for this?
shopt -s globstar
jupytext --sync **/*.ipynb
jupytext --sync {dir_a,dir_b,dir_c}/**/*.ipynb
@hectormz<https://github.com/hectormz> sorry that I missed this issue, indeed in the dict-like representation you can't have an empty prefix at the moment, I will fix that in a future version.
-
Reply to this email directly, view it on GitHub<#1144 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AOTZCQ6KSYLSZCRKRDUZAN3ZFNHENAVCNFSM6AAAAAA6HQ2SUCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBTHE2DOMZXGM>.
You are receiving this because you were mentioned.Message ID: ***@***.******@***.***>>
|
I would like to pair
.ipynb
files with.py
files according to this structure: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:I am open to manually pairing each
.py
and.ipynb
pair or puttingjupytext.toml
config files in each project directory if that will help (Alpha
,Beta
,Gamma
)The text was updated successfully, but these errors were encountered: