Repository navigation
MAINT/TST: Fix/Silence DeprecationWarnings - #5132
jbrockmendel wants to merge 10 commits into
Conversation
|
Only the massive set of new warnings should be suppressed. 0 div should still be allowed since these are really errors in test design. |
| @classmethod | ||
| def _drop_nans(cls, x, nan_mask): | ||
| if hasattr(x, 'ix'): | ||
| if hasattr(x, 'loc'): |
There was a problem hiding this comment.
cleaner to check for Series, DataFrame
| @classmethod | ||
| def _drop_nans_2d(cls, x, nan_mask): | ||
| if hasattr(x, 'ix'): | ||
| if hasattr(x, 'loc'): |
| Return the t-statistic for a given parameter estimate. | ||
| """ | ||
| return self.params / self.bse | ||
| with np.errstate(divide="ignore"): |
There was a problem hiding this comment.
Should be shown to end users. Probably don't suppress here or in tests.
There was a problem hiding this comment.
Will revert here; merits discussion elsewhere.
| lam = np.empty(shape=(self.nres,)) | ||
| for i in range(self.nres): | ||
| ind = np.random.random_integers(0, n-1, size=(n,1)) | ||
| ind = np.random.randint(0, n-1, size=(n, 1)) |
There was a problem hiding this comment.
Needs to be (0,n,size=(n,1)) -> not the deprecation warning saying +1. Former was closed. This is open.
| e = e - np.mean(e) # recenter residuals | ||
| for i in range(self.nboot): | ||
| ind = np.random.random_integers(0, n-1, size=(n,1)) | ||
| ind = np.random.randint(0, n-1, size=(n, 1)) |
| ---------- | ||
| See Racine, J.: "Consistent Significance Testing for Nonparametric | ||
| Regression" Journal of Business \& Economics Statistics. | ||
| Regression" Journal of Business \\& Economics Statistics. |
There was a problem hiding this comment.
Why does this need any escaping?
There was a problem hiding this comment.
I'd be happy without; assumed previous author had a reason. Will change.
| @@ -59,8 +59,8 @@ class TheilGLS(GLS): | |||
|
|
|||
| .. math:: q = R \beta + v | |||
There was a problem hiding this comment.
Better to make the docstring raw and leave single escapes than to mix and match escaped-escapes and non-escape sequences (e.g., \ and \b)
There was a problem hiding this comment.
Yah, wasn't super-happy with this mixed case thing.
| :math:`E(u) = 0`, :math:`cov(u) = \Sigma` | ||
| :math:`cov(u, v) = \Sigma_p`, with full rank. | ||
| :math:`E(u) = 0`, :math:`cov(u) = \\Sigma` | ||
| :math:`cov(u, v) = \\Sigma_p`, with full rank. |
There was a problem hiding this comment.
raw docstrings are just better with LaTeX math
|
I have quite a few that you don't have. but we have overlap, so will have conflicts Feel free to take them from mine into this and I'll close mine. |
|
I should add the dead simplest way to avoid these warnings (temporarily) is to pip install pytest==3.7 which will pin to the last version that worked. |
Fair enough.
I was thinking that you're more likely to get this past the maintainer in a timely manner than I am, so we should go the other way. |
|
Can your make a PR with just this: I'm not sure whether there is not also a bug in pytest 3.8, and I would rather not change a lot of things right away, and let other packages figure this out first. also there is |
What bug are you referring to?
Referring to regexes or docstrings or both?
Totally out of character. bashtage and I have unfortunate timing when it comes to trying to be helpful. I think the thing to do is merge #5135 when feasible and I'll rebase+repush with just the non-overlapping changes. |
|
All of the back slashes I looked at were incorrect. Mostly missing raw
string flags.
…On Thu, Sep 6, 2018, 22:26 jbrockmendel ***@***.***> wrote:
I'm not sure whether there is not also a bug in pytest 3.8
What bug are you referring to?
I'm a bit suspicious whether all this backslashes are really incorrect.
Referring to regexes or docstrings or both?
and I would rather not change a lot of things
Totally out of character.
bashtage and I have unfortunate timing when it comes to trying to be
helpful. I think the thing to do is merge #5135
<#5135> when feasible and
I'll rebase+repush with just the non-overlapping changes.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#5132 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AFU5RRPkHCFYGdoEJuarPgC8-7fb0vAAks5uYdlmgaJpZM4Wd4F7>
.
|
|
what about the regexes like (Even if everything is fine, then I don't want to see the same deprecation warnings a thousand times each time pandas or numpy changes something that affects patsy or statsmodels.) |
6cae5a7 to
fab2e22
Compare
|
Rebased following #5135. |
|
LGTM |
|
@josef-pkt should I bother rebasing or is that just going to clog the CI? |
|
Should be rebased and merged. Solves, among other issues, statsmodels calling code that statsmodels has deprecated. |
|
@josef-pkt is using the deprecated methods in penalties intentional? It seems that updating to using the non-deprecated methods is causing test failures. |
|
@josef-pkt this actually includes a non-trivial thing that does need your attention |
Each commit addresses a single source of these warnings.
Kept peripheral cleanup to a near minimum (the case that strayed farthest from this goal was that last commit, which touches regression._prediction and genmod._prediction).
It's conceivable that the way _penalties currently works is intentional, but it looks like
gradwas deprecated but internal usage was not updated to reflect that. If this perception is wrong then this commit will have to be reverted and those warnings addressed separately.Made an executive decision to stop passing through numpy's
RuntimeWarnings whentvaluesincludes a division by zero. On balance those tend to occur when other convergence-type problems occur, and an additional warning isn't all that helpful.patsychange to makedesign_info.buildernot need the.builderis effective as of patsy4.0, which is the required version according to setup.py