pymc-devs / pymc

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

Refactor `get_tau_sigma` and support lists of variables #7185

Closed tvwenger closed 7 months ago

tvwenger commented 7 months ago

What is this PR about? This PR refactors the get_tau_sigma logic in order to support lists of Variables and fixes https://github.com/pymc-devs/pymc/issues/6987.

N.B. The original code had a positivity check for non-Variable arguments, but not for Variable arguments. Since this PR casts the arguments to Variable, I've removed the positivity check for non-Variable arguments.

Resubmission of https://github.com/pymc-devs/pymc/pull/6988

Checklist

Major / Breaking Changes

New features

Bugfixes

Documentation

Maintenance


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

tvwenger commented 7 months ago

@ricardoV94 other branch got mucked up during upstream rebase, so I closed that PR in favor of this one. It's ready for review when the checks are complete.

codecov[bot] commented 7 months ago

Codecov Report

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

Project coverage is 92.26%. Comparing base (47f6d9e) to head (dfec0af).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/pymc-devs/pymc/pull/7185/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/7185?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 #7185 +/- ## ========================================== + Coverage 92.24% 92.26% +0.02% ========================================== Files 100 100 Lines 16888 16880 -8 ========================================== - Hits 15578 15574 -4 + Misses 1310 1306 -4 ``` | [Files](https://app.codecov.io/gh/pymc-devs/pymc/pull/7185?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pymc-devs) | Coverage Ξ” | | |---|---|---| | [pymc/distributions/continuous.py](https://app.codecov.io/gh/pymc-devs/pymc/pull/7185?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pymc-devs#diff-cHltYy9kaXN0cmlidXRpb25zL2NvbnRpbnVvdXMucHk=) | `97.79% <100.00%> (+0.25%)` | :arrow_up: | ... and [1 file with indirect coverage changes](https://app.codecov.io/gh/pymc-devs/pymc/pull/7185/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pymc-devs)
tvwenger commented 7 months ago

I had to revert the behavior for negative tau since it broke other tests.

tvwenger commented 7 months ago

@ricardoV94 Ready to merge

ricardoV94 commented 7 months ago

Thanks @tvwenger