-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Add public testing function to mock sample
#7761
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
base: main
Are you sure you want to change the base?
Conversation
Maybe |
from pymc.testing import mock_sample | ||
|
||
|
||
@pytest.fixture(scope="module") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO we should just provide this fixture, since this is how it will be used in most cases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've run into some issue with the scope. I forget the exact rules but it seems like there is some clash when scope is different. That is my only worry so we don't need to define all the scopes. Will explore
The name is OK for me, not sure what would be better |
I guess mock sounds like both a verb and adjective |
It's clear from the context which is being used |
Another subtle item here is that Flat and HalfFlat will not be mocked with this function. But that is seems a bit separate That was needed for this: https://github.com/williambdean/pymc-examples/blob/69563da49ceef589127140d3675a05b2ba4c3ae0/scripts/run_notebooks/injected.py#L72-L74 |
We could rewrite Flat and HalfFlat to Uniform and HalfUniform with big bounds (like -1e9 to 1e9) for the purposes of the tests? Is that too overkill? |
I think that would be in the actual fixture since that provides the setup and breakdown. This function by itself doesn't |
Yeah for sure. But a flat-to-uniform model transformation might potentially be in-scope for this PR |
Did HalfNormal and Normal. How's that? And as for the use, does that seem reasonable for how others will define? It would require |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #7761 +/- ##
=======================================
Coverage 92.83% 92.84%
=======================================
Files 107 107
Lines 18343 18367 +24
=======================================
+ Hits 17028 17052 +24
Misses 1315 1315
🚀 New features to boost your workflow:
|
sample
We should add an entry to the docs |
Done |
Description
Related to pymc-devs/pymc-extras#464
CC: @jessegrabowski
Related Issue
Checklist
Type of change