Skip to content
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

More dtype tracking #91

Merged
merged 9 commits into from Mar 25, 2015
Merged

More dtype tracking #91

merged 9 commits into from Mar 25, 2015

Conversation

mrocklin
Copy link
Member

Fixes #89

As @shoyer brings up, #87 is incomplete and contains wrong results. We'll fix some here. Presumably we'll fail to find a few. Is the current approach best or should we always rely on some small amount of computation?

if not all(a._dtype is not None for a in arrays):
if 'dtype' in kwargs:
dt = kwargs['dtype']
elif not all(a._dtype is not None for a in arrays):
Copy link
Member

Choose a reason for hiding this comment

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

This is the same as elif any(a._dtype is None for a in arrays), I think?

That would avoid the double-negative

isinf = wrap_elemwise(np.isinf)
isnan = wrap_elemwise(np.isnan)
isinf = wrap_elemwise(np.isinf, dtype='bool')
isnan = wrap_elemwise(np.isnan, dtype='bool')
Copy link
Member

Choose a reason for hiding this comment

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

isnull and notnull are also always dtype=bool

@mrocklin
Copy link
Member Author

OK, tests now cover all elementwise operations (I think) and dtype checking is tied into all tests.

@mrocklin
Copy link
Member Author

Merging this soon if no comment.

mrocklin added a commit that referenced this pull request Mar 25, 2015
@mrocklin mrocklin merged commit b471143 into dask:master Mar 25, 2015
@mrocklin mrocklin deleted the more-dtypes branch March 25, 2015 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dtype promotion rules are not quite right for element-wise ufuncs
2 participants