pymc-devs / pymc

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

Rename `moment` to `support_point` #7166

Closed aerubanov closed 7 months ago

aerubanov commented 7 months ago

Description

Rename moment method to avoid confusion with distribution mean.

Related Issue

Checklist

Type of change


📚 Documentation preview 📚: https://pymc--7166.org.readthedocs.build/en/7166/

codecov[bot] commented 7 months ago

Codecov Report

Attention: Patch coverage is 96.39175% with 7 lines in your changes are missing coverage. Please review.

Project coverage is 92.26%. Comparing base (74748c7) to head (32f3fd2). Report is 2 commits behind head on main.

Additional details and impacted files [![Impacted file tree graph](https://app.codecov.io/gh/pymc-devs/pymc/pull/7166/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/7166?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 #7166 +/- ## ========================================== - Coverage 92.29% 92.26% -0.04% ========================================== Files 101 101 Lines 16947 16966 +19 ========================================== + Hits 15642 15653 +11 - Misses 1305 1313 +8 ``` | [Files](https://app.codecov.io/gh/pymc-devs/pymc/pull/7166?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pymc-devs) | Coverage Δ | | |---|---|---| | [pymc/distributions/censored.py](https://app.codecov.io/gh/pymc-devs/pymc/pull/7166?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pymc-devs#diff-cHltYy9kaXN0cmlidXRpb25zL2NlbnNvcmVkLnB5) | `100.00% <100.00%> (ø)` | | | [pymc/distributions/continuous.py](https://app.codecov.io/gh/pymc-devs/pymc/pull/7166?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pymc-devs#diff-cHltYy9kaXN0cmlidXRpb25zL2NvbnRpbnVvdXMucHk=) | `97.53% <100.00%> (ø)` | | | [pymc/distributions/discrete.py](https://app.codecov.io/gh/pymc-devs/pymc/pull/7166?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pymc-devs#diff-cHltYy9kaXN0cmlidXRpb25zL2Rpc2NyZXRlLnB5) | `99.10% <100.00%> (ø)` | | | [pymc/distributions/mixture.py](https://app.codecov.io/gh/pymc-devs/pymc/pull/7166?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pymc-devs#diff-cHltYy9kaXN0cmlidXRpb25zL21peHR1cmUucHk=) | `94.95% <100.00%> (ø)` | | | [pymc/distributions/multivariate.py](https://app.codecov.io/gh/pymc-devs/pymc/pull/7166?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pymc-devs#diff-cHltYy9kaXN0cmlidXRpb25zL211bHRpdmFyaWF0ZS5weQ==) | `93.78% <100.00%> (ø)` | | | [pymc/distributions/simulator.py](https://app.codecov.io/gh/pymc-devs/pymc/pull/7166?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pymc-devs#diff-cHltYy9kaXN0cmlidXRpb25zL3NpbXVsYXRvci5weQ==) | `84.17% <100.00%> (ø)` | | | [pymc/distributions/timeseries.py](https://app.codecov.io/gh/pymc-devs/pymc/pull/7166?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pymc-devs#diff-cHltYy9kaXN0cmlidXRpb25zL3RpbWVzZXJpZXMucHk=) | `94.45% <100.00%> (ø)` | | | [pymc/distributions/truncated.py](https://app.codecov.io/gh/pymc-devs/pymc/pull/7166?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%> (ø)` | | | [pymc/initial\_point.py](https://app.codecov.io/gh/pymc-devs/pymc/pull/7166?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pymc-devs#diff-cHltYy9pbml0aWFsX3BvaW50LnB5) | `100.00% <100.00%> (ø)` | | | [pymc/testing.py](https://app.codecov.io/gh/pymc-devs/pymc/pull/7166?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pymc-devs#diff-cHltYy90ZXN0aW5nLnB5) | `91.10% <80.00%> (-0.39%)` | :arrow_down: | | ... and [1 more](https://app.codecov.io/gh/pymc-devs/pymc/pull/7166?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pymc-devs) | |
aerubanov commented 7 months ago

I renamed moment to finite_logp_point in code. Will change docs accordingly next step.

aerubanov commented 7 months ago

@ricardoV94 could you please take a look?

ricardoV94 commented 7 months ago

@aerubanov great work. I have some suggestions, let me know what you think:

  1. Instead of finite_logp_point, call it support_point? A bit less verbose and still precise
  2. Don't break code for people defining Distributions with moment methods or using the old _moment dispatch or the user-helper moment. Instead issue an informative FutureWarning about the name change.
aerubanov commented 7 months ago

@ricardoV94 your suggestions sounds good, will implement it