Message_ix/Jupyter/Git Version Control and execution_count

52 views
Skip to first unread message

jasper...@googlemail.com

unread,
May 28, 2018, 11:47:59 AM5/28/18
to message_ix
Dear all,
in our group we keep all members updated through Gitkraken.

One thing that hinders us is that Jupyter writes an execution_count in the ipynb. Thus even if I commit just a single line of code, Gitkraken/Tortoise shows hundreds of lines of modified code, i.e these updated execution_count numbers.

Is there a way to make it more obvious, where the 'real coding' has been done?

Best regards
Jasper

Matthew Gidden

unread,
May 28, 2018, 1:34:45 PM5/28/18
to jasper...@googlemail.com, message_ix
Hi Jasper,

Thanks for pinging the list! Unfortunately, the Jupyter notebooks are not the best medium for file-based version control for exactly the reason you mention. It is possible to use some save hooks to clear out these things (here is one source on how to do that [1]), but it may be a bit daunting. The short answer is don't save notebooks in version control with output (you can always "clear output" before saving) or move the bits of analysis that are commonly used into a separate script and version control that. The longer answer is look to [1] for other solutions.

Cheers,
Matt


--
You received this message because you are subscribed to the Google Groups "message_ix" group.
To unsubscribe from this group and stop receiving emails from it, send an email to message_ix+unsubscribe@googlegroups.com.
To post to this group, send email to messa...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/message_ix/d426402a-ada0-453d-8527-f246379bc1e1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages