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

edit jupytext github action to preserve cell ids #2

Merged
merged 1 commit into from
Jul 26, 2024
Merged

Conversation

neptunes5thmoon
Copy link
Contributor

I was playing around with the gh action and I think I found a way to preserve the cell ids which means there's no changes to the notebooks if the solution.py file hasn't changed and then the commit is avoided.

More specifically, the --update flag for jupytext preserves the cell id but also the output. So I instead remove the outputs with the nbconvert.

Haven't tested it super thorougly but e.g. this commit dlmbl/unet@4e917ed was not followed by a ghaction commit

Copy link
Contributor

@msschwartz21 msschwartz21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for investigating this further :)

Should we remove the clear outputs for the solution notebook? Or leave a note somewhere that it's optional?

@neptunes5thmoon
Copy link
Contributor Author

I hadn't considered keeping the outputs in the solution notebook before today. I'll play around with that a bit and then update

@neptunes5thmoon
Copy link
Contributor Author

hmm, I think it's not straightforward to just keep the output cells. Problem is that any updates to solution.py don't show up in the notebook till the gh action is being run and what's kept are the old output cells without the updates. At least that's my understanding.

Not really sure how you get around that.

@msschwartz21
Copy link
Contributor

Ok yeah that's a good point. Let's stick with removing the outputs and if someone is really committed to keeping the solution outputs they can figure out a different approach.

@msschwartz21 msschwartz21 merged commit f4c66da into main Jul 26, 2024
1 check passed
@msschwartz21 msschwartz21 deleted the fix/ghaction branch July 26, 2024 18:58
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

Successfully merging this pull request may close these issues.

2 participants