-
-
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
Remove several deprecated model properties and deprecate new ones #7033
Remove several deprecated model properties and deprecate new ones #7033
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #7033 +/- ##
=======================================
Coverage 92.16% 92.16%
=======================================
Files 101 101
Lines 16839 16827 -12
=======================================
- Hits 15520 15509 -11
+ Misses 1319 1318 -1
|
@@ -559,6 +565,7 @@ def __init__( | |||
|
|||
@property | |||
def model(self): | |||
warnings.warn("Model.model property is deprecated. Just use Model.", FutureWarning) |
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.
🤣
@@ -646,7 +653,7 @@ def compile_dlogp( | |||
jacobian: | |||
Whether to include jacobian terms in logprob graph. Defaults to True. | |||
""" | |||
return self.model.compile_fn(self.dlogp(vars=vars, jacobian=jacobian)) | |||
return self.compile_fn(self.dlogp(vars=vars, jacobian=jacobian)) |
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.
Should not it be root model instead?
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.
This is the previous behavior. I don't know what should be happening with compiled function of nested models.
I think nested models are a mistake. The functionality we want to provide with them (plating) is much more narrow than what nested models do. We should probably use something like OpFromGraph
for nested models, but that's another story.
4093531
to
e76ccb4
Compare
Sometimes less is more...
The
self.model
seems to have been introduced with ancient GLM / ModelBuilder ideas: #1525@lucianopaz and I were surprised when we found it today. We thought we were getting a wrong object that wrapped model, but no, model does in fact have the most useless property ever :)
The deprecation of
pytensor_config
was discussed in #5915 and I think it's as good time as any to deprecate it.@ferrine was the proponent of this functionality. This only seems relevant if you want different modes for different models, but I say power-users can just use
pytensor.config.change_flags
manually or build a helper that achieves the same functionality. The goal here is less magic. Note that this wouldn't work for nested models nor after cloning from fgraph asdo
andobserve
do.Removed a bunch of methods that were deprecated sometime ago
📚 Documentation preview 📚: https://pymc--7033.org.readthedocs.build/en/7033/