Skip to content

Strategy to convert Model.logpt from property to more flexible method. #5333

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

Closed
ricardoV94 opened this issue Jan 10, 2022 · 2 comments
Closed

Comments

@ricardoV94
Copy link
Member

ricardoV94 commented Jan 10, 2022

In #5320 We removed most of the Factor property variations in favor of 3 methods that accept optional vars and jacobian arguments (and sum in the case of logp).

This was pretty painless except for the need to add (or rather make use of the not yet implemented) but verbose Model.logp_elemwiset as the default flexible method to extract logp terms. Ideally this would be done by a Model.logpt(vars=None, jacobian=True, sum=True) method in line with the Model.dlogpt and Model.d2logpt, but since the model.logpt is a property (and a commonly used one I guess), this is not trivial to refactor without breaking changes.

Unless we are okay with a breaking change in time for V4, this is the strategy I could see:

  1. V4.0 Model.logpt (property) -> Model.scalar_logpt (property); FutureWarning: Model.logpt will become a method in the next release.
  2. V4.1 Model.logp_elemwiset (method) -> Model.logpt (method) (GOAL); FutureWarning Model.logp_elemwiset and Model.scalar_logpt will be deprecated in favor of Model.logpt.
  3. V4.2 Remove both Model.scalar_logpt and Model.logp_elemwiset.

The whole Factor BaseClass is also pretty useless at this point since only Model inherits from it in V4.

@twiecki
Copy link
Member

twiecki commented Jan 10, 2022

I think we should have a breaking change, we change so many things already, like RV.logp() and this one is very internal.

@canyon289
Copy link
Member

canyon289 commented Jan 10, 2022

Break things and lets move into the future please! Whats becoming really confusing in this codebase is 3 ways to do things, the old way, the new "temporary way", the "when everything is ready way". Keeping the old way around "just for compatibility" has a big downside

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants