pymc-devs / pymc

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

Add `_print_name` to Truncated and CustomDists #7205

Closed ricardoV94 closed 6 months ago

ricardoV94 commented 6 months ago

Description

Checklist

Type of change


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

codecov[bot] commented 6 months ago

Codecov Report

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

Project coverage is 90.29%. Comparing base (30d00fe) to head (d9687a8).

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/pymc-devs/pymc/pull/7205/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/7205?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 #7205 +/- ## ========================================== - Coverage 92.29% 90.29% -2.00% ========================================== Files 100 100 Lines 16874 16875 +1 ========================================== - Hits 15574 15238 -336 - Misses 1300 1637 +337 ``` | [Files](https://app.codecov.io/gh/pymc-devs/pymc/pull/7205?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pymc-devs) | Coverage Ξ” | | |---|---|---| | [pymc/distributions/distribution.py](https://app.codecov.io/gh/pymc-devs/pymc/pull/7205?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pymc-devs#diff-cHltYy9kaXN0cmlidXRpb25zL2Rpc3RyaWJ1dGlvbi5weQ==) | `94.29% <ΓΈ> (ΓΈ)` | | | [pymc/distributions/truncated.py](https://app.codecov.io/gh/pymc-devs/pymc/pull/7205?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pymc-devs#diff-cHltYy9kaXN0cmlidXRpb25zL3RydW5jYXRlZC5weQ==) | `99.40% <100.00%> (+<0.01%)` | :arrow_up: | ... and [6 files with indirect coverage changes](https://app.codecov.io/gh/pymc-devs/pymc/pull/7205/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pymc-devs)
jessegrabowski commented 6 months ago

Looks good. Is Truncated the only "wrapper" distribution that needs special treatment? I thinking aboutCensored, maybe?

ricardoV94 commented 6 months ago

Looks good. Is Truncated the only "wrapper" distribution that needs special treatment? I thinking aboutCensored, maybe?

Truncated is special because it doesn't just operate on the input dist, but does either icdf or rejection sampling, so it doesn't print the name nicely, whereas for Censored you see something like Censored(normal(0, 1), ...)