8000 BUG: np.float16 not recognized in np.common_type by mhvk · Pull Request #6004 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

BUG: np.float16 not recognized in np.common_type #6004

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

Merged
merged 1 commit into from
Jun 22, 2015

Conversation

mhvk
Copy link
Contributor
@mhvk mhvk commented Jun 22, 2015

This fixes the bug found while working on #6001, that np.float16 is not recognized as a type by np.common_type:

np.common_type(np.array(5., np.float16))
# TypeError: can't get common type for non-numeric array

_nx.cdouble: 1,
_nx.clongdouble: 2}
array_type = [[_nx.half, _nx.single, _nx.double, _nx.longdouble],
[None, _nx.csingle, _nx.cdouble, _nx.clongdouble]]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the None needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, since the number for complex and float has to be the same; e.g., important for

np.common_type(<some complex256 array>, <some float32 array>)

(And also, if someone ever implements complex32, we're ready for it!).

@charris
Copy link
Member
charris commented Jun 22, 2015

LGTM modulo question.

@charris charris added this to the 1.10.0 release milestone Jun 22, 2015
charris added a commit that referenced this pull request Jun 22, 2015
BUG: np.float16 not recognized in np.common_type
@charris charris merged commit d2d1dd5 into numpy:master Jun 22, 2015
@charris
Copy link
Member
charris commented Jun 22, 2015

OK, thanks @mhvk .

@mhvk mhvk deleted the lib-type-check-float16 branch June 22, 2015 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0