-
-
Notifications
You must be signed in to change notification settings - Fork 417
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
enabled type checking for io_pymc3 input #1629
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -139,6 +139,16 @@ def test_from_pymc_predictions(self, data, eight_schools_params): | |
assert ivalues.shape[0] == 1 # one chain in predictions | ||
assert np.all(np.isclose(ivalues[0], values)) | ||
|
||
def test_from_pymc_trace_inference_data(self): | ||
# check if error is raised successfully after passing InferenceData as trace | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be a docstring using |
||
with pm.Model(): | ||
p = pm.Uniform("p", 0, 1) | ||
pm.Binomial("w", p=p, n=2, observed=1) | ||
trace = pm.sample(100, chains=2, return_inferencedata=True) | ||
assert isinstance(trace, InferenceData) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we don't need to sample from a model, we can use an example inferencedata or create it with |
||
with pytest.raises(ValueError): | ||
from_pymc3(trace=trace) | ||
|
||
def test_from_pymc_predictions_new(self, data, eight_schools_params): | ||
# check creating new | ||
inference_data, posterior_predictive = self.make_predictions_inference_data( | ||
|
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 would say something along the lines of raising an informative error if inferencedata is passed