Repository navigation
Conversation
|
There is, sometimes it takes a little while to kick in. |
| else: | ||
| dt = None | ||
| return reduction(a, chunk.nanprod, chunk.prod, axis=axis, | ||
| return reduction(a, chunk.nanprod, chunk.nanprod, axis=axis, |
There was a problem hiding this comment.
is this really necessary? if so, can you write a test case for it?
There was a problem hiding this comment.
Good call, thank you for catching me on this really stupid error! The nanprod always returns at least a 1, likewise for nansum returning a 0. Sorry about the confusion. I've fixed this by reverting back to the correct code.
272ce54 to
02bb7e5
Compare
| reduction_1d_test(da.nansum, a, np.nansum, x) | ||
| with ignoring(AttributeError): | ||
| reduction_1d_test(da.nanprod, a, np.nanprod, x) | ||
| reduction_1d_test(da.nancumprod, a, np.nancumprod, x) |
There was a problem hiding this comment.
These unit tests aren't actually being run unless dask is testing against numpy master. That might be a good idea, actually, but in the meantime you might want to add a backport to dask, too.
There was a problem hiding this comment.
By this you mean just making sure I'm running with the master versions of numpy, xarray, and dask, right? Once I did this the xarray.prod error went away.
There was a problem hiding this comment.
Rather, I'm guessing you mean something like I did for xarray: https://github.com/pydata/xarray/pull/812/files#diff-58edd1ff722ba75004a4318ad649d76aR254 (Rather I should say that you initially setup)
There was a problem hiding this comment.
Yes, exactly. The unit tests for dask need to run on Travis CI.
There was a problem hiding this comment.
Partially, I did add the backport but am still failing on CI for python < 3.4. However, I think I've set this up quite right just yet. Please let me take another look...
There was a problem hiding this comment.
There a multiple failing tests on master so I'm not 100% sure if I've gotten all the errors, especially on older platforms because I'm running with the newest version of numpy. I modified the code a little further to make sure these tests run via the import from the backport in the case where they are not in numpy. So, I would say this comment on this line of code is resolved now by 256d94b.
There was a problem hiding this comment.
I think this is close, if not fully, resolves the problem. Thanks @shoyer for the tip about backports.
|
|
|
Sorry for the delay in review. You can safely ignore the BLOSC issues. |
|
@mrocklin, can you please say more about the BLOSC issues? I'm not familiar with acronym. |
|
You can safely ignore all errors in the most recent travis tests. They're unrelated to your work here. |
|
I did have an error because I didn't import |
|
@mrocklin, all tests pass except |
|
We do have a numpy license hanging around. Maybe add |
| def nancumprod(self, axis, dtype=None): | ||
| """ See da.nancumprod for docstring """ | ||
| from .reductions import nancumprod | ||
| return nancumprod(self, axis, dtype) |
There was a problem hiding this comment.
It looks like numpy doesn't add the nan-reductions as methods. Not sure if we want to add them or not. There was a bit of discussion on this after you and I ran into it together: #1045
I can go either way
There was a problem hiding this comment.
agreed, I would not add them here.
|
@shoyer any final thoughts on this? |
|
looks good to me! @pwolfram thanks for your work on this one! |
|
Rebased, fixed the method thing, and merged. |
In response to pydata/xarray#812