-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
doctest failure in time.core with --remote-data #2958
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
Conversation
Note, this is with Numpy 1.9. Could this be one of those Numpy 1.9 bugs I've heard about? |
Confirmed, at least, that this only happens with Numpy 1.9. |
So this seems to have something to do with this:
in iers.py. The array returned from In Numpy < 1.9 the |
Ah, my mistake. However, according to the Numpy docs we should only have |
cc @mhvk, who might have some ideas here. |
…lumn (which prevents reading of IERS_A files)
I think the change is that in numpy 1.8 and before,
I made this into a PR, but do think we should try to do something better. I'll see if I can have a look at how |
I don't think the issue is necessarily on |
👍 |
I looked a bit more at |
I think this may need to be raised upstream. I can imagine how the current behavior might be intentional, but it's also surprising and undocumented, and it's not clear how best to handle this case. |
@embray -- see numpy/numpy#5095. It also has a suggestion for what I think would be the ideal behaviour. Not sure how to implement it myself, but hopefully one of the people with a better sense of the numpy internals can help! |
Well this fix is good enough for now. We can deal with the upstream issue later. |
doctest failure in time.core with --remote-data
doctest failure in time.core with --remote-data
I ran the tests in the v0.4.x branch with the
--remote-data
option and got one failure:For some reason this did not occur in Python 2.6 (though I need to double check this). It also does not occur in Python 3, but only because we don't run the doctests there. However, when I run the same test manually in Python 3.4 I get the same traceback.
Update: After further testing I can reduce this to a simpler case:
What this demonstrates is that for the output from the
np.where
call, Numpy creates a newMyArray
without calling its__new__
, and then calls its__array_finalize__
without a template to copy from. In thinking about it this behavior seems intentional. It kind of makes sense. But if it is intentional Numpy's docs don't mention this mode of operation.The solution, I think, is to set sensible defaults for the column's necessary attributes in
__array_finalize__
even when no template is given.