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

Remove NoDistribution and enable .dist API for Simulator and DensityDist #6110

Merged
merged 4 commits into from
Sep 11, 2022

Conversation

ricardoV94
Copy link
Member

@ricardoV94 ricardoV94 commented Sep 9, 2022

What is this PR about?

The NoDistribution was used originally for Simulator, to allow RVs in the graph, but that hasn't been needed for sometime.

Besides removing that class, this PR also implements the .dist API for DensityDist and Simulator so that they behave more like other Distributions. The only difference is that a class_name is required as these classes create new types dynamically.

Closes #6031

Checklist

Major / Breaking Changes

  • Remove NoDistribution in favor of Distribution

Bugfixes / New features

  • DensityDist and Simulator can now be created via the .dist API

Docs / Maintenance

  • ...

@ricardoV94 ricardoV94 marked this pull request as ready for review September 9, 2022 14:38
@codecov
Copy link

codecov bot commented Sep 9, 2022

Codecov Report

Merging #6110 (808b0f9) into main (c6e5a92) will increase coverage by 8.65%.
The diff coverage is 11.89%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #6110      +/-   ##
==========================================
+ Coverage   59.74%   68.39%   +8.65%     
==========================================
  Files          86       86              
  Lines       17848    18027     +179     
==========================================
+ Hits        10663    12330    +1667     
+ Misses       7185     5697    -1488     
Impacted Files Coverage Δ
pymc/distributions/__init__.py 100.00% <ø> (ø)
pymc/tests/distributions/test_distribution.py 0.00% <0.00%> (ø)
pymc/tests/distributions/test_simulator.py 0.00% <0.00%> (ø)
pymc/distributions/simulator.py 34.04% <50.00%> (-53.46%) ⬇️
pymc/distributions/distribution.py 89.77% <86.66%> (+1.61%) ⬆️
pymc/gp/util.py 96.55% <100.00%> (ø)
pymc/smc/smc.py 18.89% <0.00%> (-77.56%) ⬇️
pymc/smc/sample_smc.py 16.77% <0.00%> (-66.45%) ⬇️
pymc/data.py 67.88% <0.00%> (-12.20%) ⬇️
... and 31 more

@ricardoV94 ricardoV94 merged commit 6804c96 into pymc-devs:main Sep 11, 2022
@ricardoV94 ricardoV94 deleted the remove_no_dist branch June 6, 2023 03:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Move DensityDist docstrings from __new__ to class
2 participants