pymc-devs / pymc

Bayesian Modeling and Probabilistic Programming in Python
https://docs.pymc.io/
Other
8.53k stars 1.98k forks source link

Fix error in warn_treedepth when using multiple NUTS samplers #7182

Closed ricardoV94 closed 5 months ago

ricardoV94 commented 5 months ago

Description

Fix issue reported in https://discourse.pymc.io/t/valueerror-the-truth-value-of-an-array-with-more-than-one-element-is-ambiguous-given-at-the-end-of-sampling/13875/3

Checklist

Type of change


πŸ“š Documentation preview πŸ“š: https://pymc--7182.org.readthedocs.build/en/7182/

codecov[bot] commented 5 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 92.24%. Comparing base (6c6fd13) to head (6a12657).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/pymc-devs/pymc/pull/7182/graphs/tree.svg?width=650&height=150&src=pr&token=JFuXtOJ4Cb&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pymc-devs)](https://app.codecov.io/gh/pymc-devs/pymc/pull/7182?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pymc-devs) ```diff @@ Coverage Diff @@ ## main #7182 +/- ## ======================================= Coverage 92.24% 92.24% ======================================= Files 100 100 Lines 16887 16887 ======================================= Hits 15577 15577 Misses 1310 1310 ``` | [Files](https://app.codecov.io/gh/pymc-devs/pymc/pull/7182?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pymc-devs) | Coverage Ξ” | | |---|---|---| | [pymc/stats/convergence.py](https://app.codecov.io/gh/pymc-devs/pymc/pull/7182?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pymc-devs#diff-cHltYy9zdGF0cy9jb252ZXJnZW5jZS5weQ==) | `97.43% <100.00%> (ΓΈ)` | | | [pymc/step\_methods/hmc/nuts.py](https://app.codecov.io/gh/pymc-devs/pymc/pull/7182?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pymc-devs#diff-cHltYy9zdGVwX21ldGhvZHMvaG1jL251dHMucHk=) | `97.27% <ΓΈ> (ΓΈ)` | |
ricardoV94 commented 5 months ago

Thanks for the review @junpenglao! However, I'm slightly disappointed you didn't say "LGTM"