Repository navigation
MAINT: Deprecate link aliases - #8547
Conversation
|
@josef-pkt What do you think about this? At a minimum the aliases should disappear from the docs to avoid all of the problems they create. I think it would be best to only have a canonical name. |
|
Yes, I'm all in favor, #8323 |
|
another cleanup would be to rename all lower case (sub)classes that are not duplicates/aliases to standard python class names with capitalized first letter. |
| warnings.simplefilter("error") | ||
| sm.families.NegativeBinomial(alpha=1.0) | ||
| with warnings.catch_warnings(): | ||
| warnings.simplefilter("error") |
There was a problem hiding this comment.
this is a check that NegativeBinomial raises if alpha is unchanged
needs to stay
There was a problem hiding this comment.
The warning for negbin is a UserWarning, AFAIR
so this could be more selective to handle both kinds of warning
I guess the following will only raise the UserWarning
sm.families.NegativeBinomial(link=sm.families.links.NegativeBinomial(alpha=1.0),
alpha=1.0)
| def test_get_prediction(self): | ||
| with pytest.warns(DeprecationWarning): | ||
| # deprecation warning for linear keyword | ||
| pred1 = self.res1.get_prediction() # GLM |
There was a problem hiding this comment.
why did you remove these?
I just added them a while ago.
| pred_kwds = {} | ||
|
|
||
| pred_kwds['linear'] = False | ||
| # pred_kwds['linear'] = False |
There was a problem hiding this comment.
is required to get a deprecation warning
I lost the deprecation warning and backwards compat behavior when I tried to drop this
will be merge conflict with my previous commit.
There was a problem hiding this comment.
Isn't the linear is deprecated warning old?
There was a problem hiding this comment.
AFAIR, only some in discrete like Poisson are old deprecations.
GLM is the most recent, added only 1 month ago #8505
GLM get_prediction is trickier because the return class differs between backwards compatible old "linear" usage and new "which" usage
80d4dfb to
71f4824
Compare
|
In the family module, the families have link attributes which should use the new names I'm waiting for this to be merged, then I will make a PR to make link check/exception optional. That would have many merge conflicts with the correction of families |
|
Same buggy test failed here as well. |
|
I will cleanup some warnings. I had 2 warnings for all genmod unit tests a few days ago, now there are 149 warnings |
|
@bashtage |
|
Future warning is for users, deprecation warning is for library writers. |
NumPy's guide.
Details
Notes:
needed for doc changes.
then show that it is fixed with the new code.
verify you changes are well formatted by running
flake8is installed. This command is also available on Windowsusing the Windows System for Linux once
flake8is installed in thelocal Linux environment. While passing this test is not required, it is good practice and it help
improve code quality in
statsmodels.