-
-
Notifications
You must be signed in to change notification settings - Fork 253
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
Notebook divergence, update header and footer #402
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
examples/diagnostics_and_criticism/Diagnosing_biased_Inference_with_Divergences.ipynb
Outdated
Show resolved
Hide resolved
examples/diagnostics_and_criticism/Diagnosing_biased_Inference_with_Divergences.ipynb
Outdated
Show resolved
Hide resolved
examples/diagnostics_and_criticism/Diagnosing_biased_Inference_with_Divergences.ipynb
Outdated
Show resolved
Hide resolved
Looks like black modified some line wraps which caused the notebook to diverge from the jupytext. I think you can either run precommit locally or modify the notebook by hand (so that black doesn't see anything to "fix") and resave. The offending line is in the pre-commit check: "ax=az.plot_trace({\"log(tau)\": short_trace.get_values(varname=\"tau_log__\", combine=False)}, legend=True)\n" black wants this? "ax = az.plot_trace(\n",
" {\"log(tau)\": short_trace.get_values(varname=\"tau_log__\", combine=False)}, legend=True\n",
")\n", |
The main issue is that the notebook needs to be executed sequentially and from start to end (you can do it with the restart and run all button for example). Otherwise pre-commit will (or should) continue to fail in the "check execution order step". Notebooks are not executed so we need the outputs to be included in the ipynb file or they won't appear on the website (I wrote a bit more extended explanation on ipynb+myst duplication in #403 (comment)). |
Good call. I saw that too, but wasn't sure what to make of it. @reshamas, my standard practice is to restart the jupyter kernel and rerun all cells once I am reasonably sure that my edits to a notebook are complete. That way everything is fresh and clean (until have to make more edits and then I have to rerun the entire thing again). |
@OriolAbril |
Try and see if it works, it often helps. pre-commit is a bit tricky because it only runs on staged changes, so if you have unstaged changes in the repo they are ignored and it can generate more unstaged changes, worst case scenario even overwirte unstaged changes. |
@reshamas It's better to delete it and execute in this order:
|
@symeneses I ran pre-commit and it didn't create the myst file. Not sure why. ??? |
myst_nbs/diagnostics_and_criticism/Diagnosing_biased_Inference_with_Divergences.myst.md
Outdated
Show resolved
Hide resolved
Thanks for all of your help @OriolAbril ! @symeneses |
* notebook: divergences; update notebook formatting * notebook divergence: updates,figure metadata * Divergence nb: run notebook * make code across one line * make code one line to fix myst errors from precommit * rm space around = sign * nb divergence: fix myst error with spacing * make Authorship section consistent betw notebook and myst * remove myst file * divergence notebook, after running pre-commit * run myst for divergence nb * added RS authorship to end * rerun myst on divergence nb * divergence nb: rerun myst
References
Helpful links
Notes for the Reviewer
#DataUmbrellaPyMCSprint
cc: @symeneses