-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Allow opting out of model nesting by setting model=None
#7352
Conversation
17106cf
to
9baf76b
Compare
2df14c4
to
7cfc1a7
Compare
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 wonder how .to_graphviz
looks for hierarchical models 🤔
Please apply the docstring fixes that Oriol suggested 👍
7cfc1a7
to
2d246f4
Compare
Doesn't do anything different for the outer model. You can just call |
2d246f4
to
269da5c
Compare
Description
This PR allows setting
model=None
to explicitly disable model nesting. This is needed for model transformationsdo, observe, clone, remove_value_transforms, freeze_rv_and_dims
to be possible under a model context without side-effects on the original model.I still think model nesting is an overkill, but a lot of code out there depends on it so I am not touching it.
I also updated the docstrings with more relevant (imo) examples. The previous example was broken as per #6715 and I am not sure we really want to incentivize people to subclass PyMC models. That certainly shouldn't be the focus of the docstrings?
Finally, removed deprecated functionality.
Related Issue
Checklist
Type of change
📚 Documentation preview 📚: https://pymc--7352.org.readthedocs.build/en/7352/