Repository navigation
Ignore runtimewarning about ndarray size change. - #11116
Conversation
| ignore:unclosed <socket:ResourceWarning | ||
| ignore:unclosed <ssl.SSLSocket:ResourceWarning | ||
| ignore:numpy.ufunc size changed:RuntimeWarning | ||
| ignore:numpy.ndarray size changed:RuntimeWarning |
There was a problem hiding this comment.
I suppose it appears when several binary wheels compiled against different NumPy versions interact? The oldest reference I can find is numpy/numpy#563, but there's not that much information available.
There was a problem hiding this comment.
In this case, it may be definitions about ndarray inside cython. I do think that, like for the dtype, the extension of the struct that holds the definition of an array is written such that one can always use the old version.
There was a problem hiding this comment.
Could the changes on PyArrayObject affect us in some way ?
https://mail.python.org/pipermail/numpy-discussion/2020-November/081213.html
There was a problem hiding this comment.
Will ignoring this have any side effects in the future? When can we remove ignoring this warning?
There was a problem hiding this comment.
I think our code suffers only because we use cython, so at some level it is not our problem... And the thread does suggest that it it is fine to have code that relies on the old struct. So, for now I think we can simply do this...
As for when we can remove the warning: presumably whenever we have a minimum version of cython compatible with this change...
|
Merging. Thanks! |
|
Perhaps for now I will backport this to the v4.0.x branch as part of #11123. I agree, the issue relates to use of binary wheels for numpy and for other packages, probably most notably cython but maybe also matplotlib(?) that are compiled against a different numpy version. |
|
@embray , I think @astrofrog is supposed to release 4.0.5, so pinging him for his info. |
Ignore runtimewarning about ndarray size change.
Ignore runtimewarning about ndarray size change.
Ignore runtimewarning about ndarray size change.
|
This still happens to me with :
I downgraded to numpy:1.19.5 and that's ok. |
|
@kidpixo , this patch only affects pytest runs. The warning still happens if you are using astropy in a normal Python session under certain circumstances. It is up to you how you wish to handle such warning using https://docs.python.org/3/library/warnings.html |
|
@pllim ah sorry for ading noise here. |
@kidpixo , perhaps you should open a new issue and provide the minimally reproducible example of how this warning actually crashes your code. Warning is not an exception, it should not crash anything unless you explicitly set the session to turn all warnings into exception. |
I think these warnings, like for the dtype, can be ignored.
Note: Only merge if the
*devjob passes again (it does locally, but one never knows...)EDIT: Fix #11119