You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
FAQ-D/SUMM: required attributes of models and results #1970
We don't have a list of what attributes models and results need to define to be able to use generic methods.
The requirements are increasing from version to version. These requirements are usually inherited when we go through the regular data handling procedure, but might be left out if a new model follows a different pattern.
eg. we need extra attributes for wald_test (f_test, t_test)
k_constant
exog_names (which are params_names in general)
df_resid, df_model #632 #436
Just a thought on this: required attributes could be made explicit in a __new__ method that initialized everything to None. If we wanted to be strict about it, __setattr__ could be patched to disallow creating any new attributes outside of __new__.
I don't like enforcing things that reduce flexibility.
Almost every rule is broken by some models, at least during development when the focus is on getting just the minimial functionality implemented correctly.
Also this is asymmetric, there should be a common subset of attributes, but individual models still need to be able to use model specific attributes.
The main question still is about what should be in this set of common, required attributes. For which parts are they required and where do we check it. And, do we have defaults that avoid that a developer has to specify everything immediately when getting started.
Nevertheless, we have to see what else goes into the required set, and clean up the code for consistency in what is already in there like df_resid, and whatever aliases for param_names we have.
Activity
[-]SUMM: required attributes of models and results[/-][+]FAQ-D/SUMM: required attributes of models and results[/+]jbrockmendel commentedon Oct 15, 2017
Just a thought on this: required attributes could be made explicit in a
__new__method that initialized everything to None. If we wanted to be strict about it,__setattr__could be patched to disallow creating any new attributes outside of__new__.josef-pkt commentedon Oct 15, 2017
I don't like enforcing things that reduce flexibility.
Almost every rule is broken by some models, at least during development when the focus is on getting just the minimial functionality implemented correctly.
Also this is asymmetric, there should be a common subset of attributes, but individual models still need to be able to use model specific attributes.
The main question still is about what should be in this set of common, required attributes. For which parts are they required and where do we check it. And, do we have defaults that avoid that a developer has to specify everything immediately when getting started.
Nevertheless, we have to see what else goes into the required set, and clean up the code for consistency in what is already in there like df_resid, and whatever aliases for param_names we have.
josef-pkt commentedon May 22, 2018
related #3787 which attributes do or should exist