You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My git diffs are populated with a lot of entries every time I re-run cells that produce images, likely because the hashes include the memory address which changes each time.
The library which produces the plots likely uses a default text representation. Making it return something more stable should help. What library are you using and in which language?
If the document has changed, it is the job of a VCS/diff tool to tell you about it. That said, you have a few options:
Try to make matplotlib not generate this random text every time.
Use a tool to avoid saving outputs to git (multiple options exist), but of course then you will not be able to see the previous outputs. Some specific tools for notebook exists (jupytext, nbstripout), but you could also try to make your own to target this specific issue.
Configure your diff tool to ignore the outputs. E.g. for nbdime you can do this via command line flags, but note that this will ignore ALL outputs, not just the ones mentioned. And even if your diff tool doesn't show it, git will still keep committing it, and it will show up other places.
Given all this, option 1 definitely seems like the cleanest solution if you are able to, but that isn't really something we can help you with though.
My git diffs are populated with a lot of entries every time I re-run cells that produce images, likely because the hashes include the memory address which changes each time.
Could this be avoided somehow?
This discussion began here:
https://groups.google.com/g/jupyter/c/srQPpo6otKc
The text was updated successfully, but these errors were encountered: