Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup logprob module #7443

Merged
merged 4 commits into from
Aug 5, 2024
Merged

Conversation

ricardoV94
Copy link
Member

@ricardoV94 ricardoV94 commented Aug 1, 2024

Description

Some non-functional cleanup of the logprob module that spinoff from other PRs


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

Also:
* Introduce MeasurableOpMixin for string representation
* Subclass directly instead of registering manually
@ricardoV94 ricardoV94 added logprob major Include in major changes release notes section labels Aug 1, 2024

class MeasurableElemwise(Elemwise):
def __str__(self):
return f"Measurable{super().__str__()}"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This allows seeing when a Measurable replacement was actually performed in the IR graph. Most times we use a subclass of the pre-existing Op, and it would not be distinguishable in the string representation

Copy link

codecov bot commented Aug 1, 2024

Codecov Report

Attention: Patch coverage is 96.00000% with 2 lines in your changes missing coverage. Please review.

Project coverage is 92.15%. Comparing base (8eaa9be) to head (78f148f).

Files Patch % Lines
pymc/logprob/abstract.py 83.33% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #7443      +/-   ##
==========================================
- Coverage   92.18%   92.15%   -0.04%     
==========================================
  Files         103      103              
  Lines       17263    17227      -36     
==========================================
- Hits        15914    15875      -39     
- Misses       1349     1352       +3     
Files Coverage Δ
pymc/distributions/distribution.py 91.56% <100.00%> (-0.03%) ⬇️
pymc/logprob/basic.py 94.36% <100.00%> (ø)
pymc/logprob/checks.py 90.19% <100.00%> (-0.37%) ⬇️
pymc/logprob/cumsum.py 90.62% <100.00%> (-0.29%) ⬇️
pymc/logprob/mixture.py 96.03% <100.00%> (-0.04%) ⬇️
pymc/logprob/order.py 94.49% <100.00%> (-0.20%) ⬇️
pymc/logprob/rewriting.py 89.57% <100.00%> (+0.55%) ⬆️
pymc/logprob/scan.py 97.51% <100.00%> (-0.02%) ⬇️
pymc/logprob/tensor.py 77.04% <100.00%> (-0.56%) ⬇️
pymc/logprob/transform_value.py 95.36% <100.00%> (+1.65%) ⬆️
... and 4 more

Copy link
Member

@twiecki twiecki left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why can we get rid of the tests?

@ricardoV94
Copy link
Member Author

Why can we get rid of the tests?

We removed a hacky functionality that is properly implemented by the auto-imputation machinery

@ricardoV94 ricardoV94 merged commit 43dc4be into pymc-devs:main Aug 5, 2024
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
logprob maintenance major Include in major changes release notes section
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants