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

Remove several deprecated model properties and deprecate new ones #7033

Merged
merged 3 commits into from
Nov 24, 2023

Conversation

ricardoV94
Copy link
Member

@ricardoV94 ricardoV94 commented Nov 24, 2023

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 as do and observe do.

Removed a bunch of methods that were deprecated sometime ago


📚 Documentation preview 📚: https://pymc--7033.org.readthedocs.build/en/7033/

@ricardoV94 ricardoV94 changed the title Deprecate model property Deprecate model properties Nov 24, 2023
@ricardoV94 ricardoV94 added the major Include in major changes release notes section label Nov 24, 2023
@ricardoV94 ricardoV94 changed the title Deprecate model properties Deprecate several model properties Nov 24, 2023
@ricardoV94 ricardoV94 changed the title Deprecate several model properties Deprecate and remove several deprecated model properties Nov 24, 2023
@ricardoV94 ricardoV94 changed the title Deprecate and remove several deprecated model properties Remove several deprecated model properties and deprecate new ones Nov 24, 2023
Copy link

codecov bot commented Nov 24, 2023

Codecov Report

Merging #7033 (e76ccb4) into main (8ec1f08) will increase coverage by 0.00%.
Report is 1 commits behind head on main.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #7033   +/-   ##
=======================================
  Coverage   92.16%   92.16%           
=======================================
  Files         101      101           
  Lines       16839    16827   -12     
=======================================
- Hits        15520    15509   -11     
+ Misses       1319     1318    -1     
Files Coverage Δ
pymc/model/core.py 91.75% <100.00%> (+<0.01%) ⬆️

@@ -559,6 +565,7 @@ def __init__(

@property
def model(self):
warnings.warn("Model.model property is deprecated. Just use Model.", FutureWarning)
Copy link
Member

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))
Copy link
Member

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?

Copy link
Member Author

@ricardoV94 ricardoV94 Nov 24, 2023

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.

@ricardoV94 ricardoV94 merged commit 0b85d02 into pymc-devs:main Nov 24, 2023
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
major Include in major changes release notes section
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants