pymc-examples icon indicating copy to clipboard operation
pymc-examples copied to clipboard

Re-wrote "How to debug a model"

Open kuvychko opened this issue 1 year ago • 9 comments

References

  • Towards https://github.com/pymc-devs/pymc-examples/issues/109

  • References Project Board: https://github.com/pymc-devs/pymc-examples/projects/1

  • [x] Notebook follows style guide https://docs.pymc.io/en/latest/contributing/jupyter_style.html

  • [x] PR description contains a link to the relevant issue: a tracker one for existing notebooks or a proposal one for new notebooks

  • [x] Check the notebook is not excluded from any pre-commit check: https://github.com/pymc-devs/pymc-examples/blob/main/.pre-commit-config.yaml

Helpful links

  • https://github.com/pymc-devs/pymc-examples/blob/main/CONTRIBUTING.md

Notes for the Reviewer

  • I asked on Discourse for better examples, but so far I got no replies. My examples are definitely not ideal, having a realistic model failing mid-run would work much better but I haven't figured out how to achieve that. https://discourse.pymc.io/t/example-of-using-aesara-printing-print-for-model-troubleshooting/10042

#DataUmbrellaPyMCSprint

kuvychko avatar Jul 31 '22 13:07 kuvychko

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@kuvychko Thanks for this PR. Some comments below:

a) For future, I think it would be better to submit notebooks in a separate PR, no? Unless for some reason these notebooks are connected. No need to change it now.

b) The description of this PR needs some text. Here is an example of what can be added:
https://github.com/pymc-devs/pymc-examples/pull/401

c) The debug notebook has this issue opened by @OriolAbril: https://github.com/pymc-devs/pymc-examples/issues/109

Towards #109

d) For the history of the debugging notebook, I did this search: https://github.com/pymc-devs/pymc/commits/76bd40e0d1db4fd906b7d558dcf1bd79f1011963/docs/source/notebooks/howto_debugging.ipynb

e) For the history of the spline notebook, this looks like the start of it: https://github.com/pymc-devs/pymc-examples/issues/230

#DataUmbrellaPyMCSprint @symeneses

reshamas avatar Aug 01 '22 13:08 reshamas

@reshamas - thank you, really appreciate your comments and help! I made the changes accordingly.

kuvychko avatar Aug 01 '22 21:08 kuvychko

@OriolAbril - thanks for the detailed style review and comments, super helpful! I committed requested changes. Thanks!

kuvychko avatar Aug 02 '22 21:08 kuvychko

@OriolAbril Do you know what's up with rtd?

twiecki avatar Aug 08 '22 08:08 twiecki

I haven't checked, but I'd guess it is related to https://github.com/pymc-devs/pymc-examples/issues/409. That is, the PR was opened before the error happened and needs a rebase to include the version pins, otherwise the preview installes the latest and non-working versions.

OriolAbril avatar Aug 08 '22 10:08 OriolAbril

@OriolAbril - any actions needed on my part to get this PR merged? Also, anything I need to do differently for future PRs to avoid this?

kuvychko avatar Aug 12 '22 23:08 kuvychko

@OriolAbril - any actions needed on my part to get this PR merged? Also, anything I need to do differently for future PRs to avoid this?

You need to rebase upstream to origin, so that your fork is updated.

# update you main branch
git checkout main
git fetch upstream
git rebase upstream/main
# update your branch
git checkout feature
git rebase main

If this works 🤞🏽 , you should see these 2 commits when executing git log:

commit 76fae3ffff138021abf484ea4317e74d31f970cb (HEAD -> feature, upstream/main, origin/main, origin/HEAD, main)
Author: Reshama Shaikh <[email protected]>
Date:   Thu Aug 4 12:17:04 2022 -0400

commit 50db8524366302c262f08505c670b995b5b88438
Author: Sandra Yojana Meneses <[email protected]>
Date:   Wed Aug 3 09:57:04 2022 +0200

    Upgrade notebook Gaussian Process to V4 (#404)

Once you do this, push again the changes in your branch.

After you fork a repo and before your PR is closed, new PRs can be merged to main, normally, that shouldn't affect your work but in this case, the building of docs was failing due to some issues in the new versions which was fixed in a different PR as Oriol explained. So now, this PR needs to have the last update so that the docs can be built. A way to avoid this is to update your fork right before creating the PR so that your branch has the latest updates.

symeneses avatar Aug 13 '22 09:08 symeneses

@symeneses - thank you!!! looks like it worked 👍

kuvychko avatar Aug 13 '22 15:08 kuvychko

@OriolAbril - any issues with the merge? I wanna make sure it doesn't fall through the cracks somehow. Thanks!

kuvychko avatar Aug 17 '22 01:08 kuvychko