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

Make docstring examples more stable #284

Closed
jpreszler opened this issue Dec 24, 2023 · 2 comments · Fixed by #286
Closed

Make docstring examples more stable #284

jpreszler opened this issue Dec 24, 2023 · 2 comments · Fixed by #286

Comments

@jpreszler
Copy link
Contributor

Several of the docstring examples have numeric output that changes too much leading to doctest failures.

We should change the data and models in those examples (particularly PrePostFit and RegressionDiscontinuity) to have more stability even if the examples become unrealistic or 'silly' - they will illustrate basic usage and ensure documentation is up to date with code, leaving the main docs for real examples and detailed instruction.

The main goal is that doctests should always pass unless there's been a clear change in how a function works.

@jpreszler
Copy link
Contributor Author

I'll try to get this done over the next week.

@drbenvincent
Copy link
Collaborator

I was too hasty in merging #285.

Looking into it in more detail, it looks like we are getting non reproducible results. This seems to be because we are only ingesting the sample kwargs into pm.sample. So the random_seed kwarg is not being passed into pm.sample_prior_predictive or pm.sample_posterior_predictive.

We can't simply unpack the provided kwargs into these function calls because they don't accept all the same kwargs as pm.sample.

I'll submit a PR for this.

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 a pull request may close this issue.

2 participants