-
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
File modification times and symbolic link ".ipynb seems more recent than .py" #696
Comments
Hi @siddalp-actual , thanks for sharing this! Well if I am correct we are getting the timestamp from the original context manager, through
Do you know how to get the timestamp of the file pointed by the symbolic link? Maybe then we could make a PR on Alternatively, you could
|
Thanks Marc, I will also look into your suggestion of using the triple / root in default_jupytext_formats |
Thanks @siddalp-actual . I've added this to the next milestone - my objective here is to add a test that uses the |
thanks Marc, but I don't think the linked folder, on it's own, will recreate the issue. My understanding is that when the |
Hi @siddalp-actual , we do agree - there should be no issue with symbolic links to folders. That's why I recommend using symbolic links to folders, instead of symbolic links to files 😄 A precise description of what it takes to use paired files in symlink folders is done in the test Let me recall that fixing the timestamp of symbolic links to files needs to be done in the Jupyter Core programs - as discussed above Jupytext takes the timestamp from the (parent) contents manager. |
thank you again Marc, I now entirely understand that you are solely adding tests to verify that symlinks to folders work correctly, and that this is the recommended way to tackle use cases such as mine. I wont bug you any more on this issue ;-) But will leave it for your PR to close. |
Sure, no problem! Yes I just need to adjust the test on Windows, and I'll take the opportunity of the PR to add a word about this question in the FAQ. By the way, I was thinking about what brought you to try using symbolic links, and if I am correct you wanted to include the Are the two folders under your Jupyter root, or not? Is it correct that the symbolic links are required only if you want to have either the text or the ipynb file outside of the Jupyter root - otherwise one could use the pairing in trees with three |
Marc, thank you for your interest. Warning, long post with further details on my use case, what I've tried and what I think is going to work for me. I hope it helps. You are correct: I have two project trees. One of git projects, and one of personal projects. Imagine I work on projectHybrid which I realise has code I want to expose on github, but the data etc that it runs against is personal to me. I'm trying to expose the
and
I initially tried a hard-link of the I start Jupyter with a I don't think the I'm currently heading down a road of each project having sub-folders named
and
|
Thank you @siddalp-actual for the detailed explanation! Sure I completely agree that symbolic links give you a lot of freedom in how you can distribute/segregate your files, more that what you can get with Yes I'll see how I can update the documentation on
Oh if you want to double check which config file is being used, see the Python commands at
For that one you can use the
in your main |
I'm a very newbie with jupytext and git, so I set up an odd pattern of working which seems to have exposed an issue.
I've installed jupytext and created a notebook for trying it out in the source tree I usually use for my jupyter projects.
I successfully paired the notebook with a .py file (I use jupyterlab so the command palette 'pair notebook with light script')
So I have
All works fine.
Now I went off piste as follows:
Again, all works fine with git seeing just the input cells of my notebook and I get nice succinct diffs (great, thank you).
However, when I come to reload the notebook.ipynb or notebook.py, I get the file sync error.
It would appear that the modification timestamp of the notebook.py symbolic link is being compared, rather than the modification timestamp of the file it points at.
(my reasoning for using the symbolic link to the .py file was that I wanted to version control the text and code portions of the notebook using git & github, while hiding from git the .ipynb file, .ipynb_checkpoints and any other files containing private data that I might have in my jupyter project tree. I can work around by adding entries to .gitignore to explicitly hide, which doesn't feel quite so safe as using links to explicitly expose)
The text was updated successfully, but these errors were encountered: