-
Notifications
You must be signed in to change notification settings - Fork 277
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
MinimizerResult and ModelResult inconsistencies #359
Comments
@tritemio Good point. Off hand, I would think that ModelResult should be a subclass of MinimizerResult. It might be reasonable for MinimizerResult to be a subclass of scipy.optimize.OptimizeResult, which is dict-like. OTOH, it might be most natural for MinimizerResult to inherit from Minimizer and ModelResult to inherit from Model. I don't have a strong preference, but it does seem like we could easily break existing scripts and/or expectations with such a change. So, we should be sure to get any changes right the first time, and after some careful consideration. Can we delay until 0.9.6? |
Sure, this can be postponed to 0.9.6. It makes sense to make ModelResult inherit from MinimizerResult. In this way we can document only the additional attributes in ModelResult. A subset of dict-like behaviour, namely attributes access via The dict-like API for these objects can be limited to:
In the future, these classes can also gain tidying methods. For now I would simply remove that note in the documentation since all the attributes of |
@tritemio (sorry for quick followup).... or should the docs on |
@newville, I made a PR removing the note from the docs. Further modifications can go in >0.9.5. |
@newville, yes for me it's ok to tag 0.9.5 from current master on Tuesday. Thanks! |
@RoyiAvital Use the mailing list for questions about lmfit. Do not hijack unrelated issues. |
My personal pet peeve: most of the times I use the model_fit_report = model_result.fit_report() but minimizer_fit_report = lmfit.fit_report(minimizer_result) |
The two similar classes
MinimizerResult
andModelResult
inherit from different objects (the former fromobject
the latter fromMinimizer
).Also the
MinimizerResult
doc states:which is not true ATM.
The two classes should inherit from the same object and possibly from
dict
.The text was updated successfully, but these errors were encountered: