-
-
Notifications
You must be signed in to change notification settings - Fork 11.1k
DEP: deprecate Numeric-style typecodes, closes #2148 #7476
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
The errors are due to the deprecation warnings being turned into errors in the tests. How was it that one is supposed to deal with that? If I try the offending test in a console with this PR built I get: In [4]: np.dtype('Bool')
/Users/jaimefrio/miniconda/envs/numpydev/bin/ipython:1: DeprecationWarning: Numeric-style type codes are deprecated and will result in an error in the future.
#!/bin/bash /Users/jaimefrio/miniconda/envs/numpydev/bin/python.app
Out[4]: dtype('bool') |
We have a |
Though I guess if the test does nothing else, could also just remove it, and comment on the deprecation test that it should be made an error test when done (which we would probably do anyway). |
Ohhh, sorry :(. I misread it, the Deprecation test does not work. Thought there was some other test that did not work. The deprecation test will also check the error case. You will have to pass in the |
Needs to be mentioned in release notes. I expect this will also impact some old code, possibly in astropy that inherited pyfits, so it might be a good idea to post it on the list for comment. |
In fact, none of these types seem present in current numpy nor turn up in a search. I suspect they went away with the numarray compatibility module. |
Looks like they were difined in |
NVM, they to still seem recongnized by some routines. Somehow my first check didn't turn them up... |
I had trouble hunting them down myself, but they are added to the type dictionary in the |
Another possibility here is to set up a parallel dictionary of deprecated types in |
if (DEPRECATE("Numeric-style type codes are " | ||
"deprecated and will result in " | ||
"an error in the future.") < 0) { | ||
goto fail; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the goto
right?
I suspect an error in the code. |
* Remove duplicate "Unicode0" in list of numeric types * Add TypeError for exception when deprecated type fails. * Unicode0 and String0 are not available in Python3 already. * Fix bug in _DeprecationTestCase error message.
Fixed up in #7743, so closing. Thanks Jaime. |
☔ The latest upstream changes (presumably #7747) made this pull request unmergeable. Please resolve the merge conflicts. |
Sorry for bumping this old issue. What's the expected future behavior for In [9]: np.dtype("int") == "Int64"
/Users/taugspurger/miniconda3/envs/travis-37-numpydev/bin/ipython:1: DeprecationWarning: Numeric-style type codes are deprecated and will result in an error in the future.
#!/Users/taugspurger/miniconda3/envs/travis-37-numpydev/bin/python Will that raise, or return False? |
This is probably the wrong place to bring this up, but I'm not sure on the "right" place. By mistake in some Pandas timing code I recently wrote Of course I shouldn't expect to get a Pandas object (I was mixing Pandas and NumPy timing code) but I didn't expect to get a different dtype to the one I was after. I suspect now that Pandas supports Nullable |
@ianozsvald yes you are right, the deprecation warning was added in 2016, we can definitely just remove it in master. Want to have a look? |
That's good to hear. Sorry, I'll decline doing any work, between having a baby on the way, upcoming open source conference talks and a pydata conference to help organise I'm not taking on any additional jobs. Maybe this could take on a tag for something like "good first time issue"? |
Sure, I just always ask. It would have been a bit more complicated than an easy-fix anyway probably, so opened gh-16554 instead. Thanks. |
It is sensible to ask :-) Thanks for pushing it on. The work of all of you maintainers is much appreciated! |
The new tests were failing locally, although they seemingly shouldn't, submitting anyway to see if it is my local setup and warnings being turned into errors.
Will add a release note once its been reviewed.