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

Refactor sample return #6546

Merged
merged 4 commits into from
Feb 26, 2023

Conversation

michaelosthege
Copy link
Member

This refactors the post-MCMC part of pm.sample into a function which simplifies testing and future refactoring.

In test_mcmc.py I consolidated the test cases, mostly by using pm.Metropolis and avoiding to re-run MCMCs just to test different flavors of discard_tuned_samples, return_inferencedata and so on.

Locally this reduced the test_mcmc.py runtime by ~200 seconds.

Maintenance

  • Post-MCMC parts of pm.sample were extracted into a function.

@codecov
Copy link

codecov bot commented Feb 25, 2023

Codecov Report

Merging #6546 (6a2ed47) into main (9b59771) will decrease coverage by 0.05%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #6546      +/-   ##
==========================================
- Coverage   91.96%   91.91%   -0.05%     
==========================================
  Files          89       89              
  Lines       14935    14936       +1     
==========================================
- Hits        13735    13729       -6     
- Misses       1200     1207       +7     
Impacted Files Coverage Δ
pymc/sampling/mcmc.py 92.12% <100.00%> (-0.22%) ⬇️
pymc/stats/convergence.py 90.35% <0.00%> (-5.27%) ⬇️

@michaelosthege michaelosthege marked this pull request as ready for review February 25, 2023 20:49
Copy link
Member

@Armavica Armavica left a comment

Choose a reason for hiding this comment

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

Nice!

@michaelosthege michaelosthege merged commit 14a10b7 into pymc-devs:main Feb 26, 2023
@michaelosthege michaelosthege deleted the refactor-sample-return branch February 26, 2023 10:50
@michaelosthege michaelosthege added the no releasenotes Skipped in automatic release notes generation label Feb 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no releasenotes Skipped in automatic release notes generation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants