Typestring "h2" works in 1.6, fails in master #294

Closed
njsmith opened this Issue Jun 5, 2012 · 9 comments

Comments

Projects
None yet
5 participants
@njsmith
Member

njsmith commented Jun 5, 2012

Problem (which breaks scipy):
http://mail.scipy.org/pipermail/numpy-discussion/2012-June/062605.html

Analysis:
http://mail.scipy.org/pipermail/numpy-discussion/2012-June/062606.html

Todo:

  • Re-enable parsing of type-strings like "h2" before the 1.7 release [DONE]
  • Give a deprecation warning for type-strings like "h100". Possibly also for type-strings like "h2" -- this isn't obvious. [DONE]
  • Disable at least "h100"- style type-strings for 1.9, or whenever we decide to finalize the deprecations that started in 1.7.
@certik

This comment has been minimized.

Show comment
Hide comment
@certik

certik Dec 26, 2012

Contributor

@njsmith, is this issue fixed now?

Contributor

certik commented Dec 26, 2012

@njsmith, is this issue fixed now?

@njsmith

This comment has been minimized.

Show comment
Hide comment
@njsmith

njsmith Dec 26, 2012

Member

The 1.7 part of it is; I moved the milestone to 1.8.

Member

njsmith commented Dec 26, 2012

The 1.7 part of it is; I moved the milestone to 1.8.

@romanstingler

This comment has been minimized.

Show comment
Hide comment
@romanstingler

romanstingler Nov 27, 2013

blackout@debian:~$ python3
Python 3.2.3 (default, Feb 20 2013, 14:44:27)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import numpy as np
np.empty((1,), dtype='>h1000000')
array([-22330], dtype=int16)
np.version
'1.9.0.dev-48981a6'
np.empty((1,), dtype='h100')
array([-14680], dtype=int16)

gives me negative numbers

blackout@debian:~$ python3
Python 3.2.3 (default, Feb 20 2013, 14:44:27)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.

import numpy as np
np.empty((1,), dtype='>h1000000')
array([-22330], dtype=int16)
np.version
'1.9.0.dev-48981a6'
np.empty((1,), dtype='h100')
array([-14680], dtype=int16)

gives me negative numbers

@charris

This comment has been minimized.

Show comment
Hide comment
@charris

charris Feb 17, 2014

Member

Working now. Types like h100 also pass as the number is simply ignored. It might be better at some point to raise an error for those.

Member

charris commented Feb 17, 2014

Working now. Types like h100 also pass as the number is simply ignored. It might be better at some point to raise an error for those.

@charris charris closed this Feb 17, 2014

@seberg

This comment has been minimized.

Show comment
Hide comment
@seberg

seberg Feb 17, 2014

Member

We do, there is a deprecation warning in place.

Member

seberg commented Feb 17, 2014

We do, there is a deprecation warning in place.

@charris

This comment has been minimized.

Show comment
Hide comment
@charris

charris Feb 17, 2014

Member

It isn't enabled, at least I don't see it.

Member

charris commented Feb 17, 2014

It isn't enabled, at least I don't see it.

@seberg

This comment has been minimized.

Show comment
Hide comment
@seberg

seberg Feb 17, 2014

Member

Just added it to the 1.7 deprecation follow up ticket. It is there (and I think was new in 1.7):

In [1]: import warnings; warnings.filterwarnings('always')

In [2]: np.dtype('h100')
/usr/bin/ipython:1: DeprecationWarning: Specified size is invalid for this data type.
Size will be ignored in NumPy 1.7 but may throw an exception in future versions.
  #! /usr/bin/python
Out[2]: dtype('int16')
Member

seberg commented Feb 17, 2014

Just added it to the 1.7 deprecation follow up ticket. It is there (and I think was new in 1.7):

In [1]: import warnings; warnings.filterwarnings('always')

In [2]: np.dtype('h100')
/usr/bin/ipython:1: DeprecationWarning: Specified size is invalid for this data type.
Size will be ignored in NumPy 1.7 but may throw an exception in future versions.
  #! /usr/bin/python
Out[2]: dtype('int16')
@seberg

This comment has been minimized.

Show comment
Hide comment
@seberg

seberg Feb 17, 2014

Member

wow, there is an explicit 1.7 there sneeking in, not quite right of course... Maybe we can even turn it into an error in 1.9...

Member

seberg commented Feb 17, 2014

wow, there is an explicit 1.7 there sneeking in, not quite right of course... Maybe we can even turn it into an error in 1.9...

@charris

This comment has been minimized.

Show comment
Hide comment
@charris

charris Feb 17, 2014

Member

Ah, gotcha. Yes, making wrong sizes an error in 1.9 seems reasonable, should be mentioned in the release notes if we do.

Member

charris commented Feb 17, 2014

Ah, gotcha. Yes, making wrong sizes an error in 1.9 seems reasonable, should be mentioned in the release notes if we do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment