-
Notifications
You must be signed in to change notification settings - Fork 12
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
Fix NotImplementedError: xarray can't set arrays with multiple array indices to dask yet.
#115
Comments
Hey @pochedls, maybe you can help look into this issue if you have time? |
@tomvothecoder - I just tried this with the latest release and I didn't get an error. I am not sure if it is automatically parallelizing, but I don't seem to be getting an error. Do you get this error with the latest release? |
@pochedls I've updated the example so that region selection is performed, which raises the error. |
@tomvothecoder - here is a proposed fix. I wonder if there are going to be a lot of little places where we need to add a Note that I get a different error than the one specified in this issue. I got this error:
This actually can speed up the code pretty substantially.
|
I get What versions are you running in your env? I am trying to reproduce your error.
Nice to see the speed gains! Have you tried using the Also, I don't think we need to have |
I just re-created my environment and can reproduce the error message that you got. I'm not sure if I was using an old environment derived from I did use |
The I'm glad to hear that your fix still holds up with the new dependencies and with |
Also, I'll compare |
@tomvothecoder - I'm working on the PR and adding some tests. I wanted to add a test that checks that spatial averaging works for chunked data, but the fixtures dataset cannot be chunked ( |
@pochedls How did you produce that error? This should work:
You can also set up your own Dataset object if the fixture isn't sufficient enough for the test(s). I often do this for specific tests cases. |
@tomvothecoder - thanks - I had mistakenly thought |
In testing this, I'm not actually sure what is going on. If I revert to the beta release, I get an error (even with a single netCDF file and no chunking) when specifying lat/lon region bounds: If I use the proposed PR something is not working with the weights when I specify a region (I am getting non-zero weights everywhere). I think this may be a package version issue, because in preliminary testing (pre-release) this was working, but I didn't have the updated dependencies. |
I can try taking a look if you can provide me with the inputs and commands to produce the errors.
It looks like a A few links that might help:
Not sure what is going on here either, but I can try debugging too.
The unit tests should catch API breaking errors, but they still pass with the latest dev env. It is difficult to pinpoint package versioning as the root of this regression given the number of possible factors (changing inputs for testing, edge cases we've missed, a bug in the code that wasn't revealed until now, etc.). However, if it were package versioning related, it could be a newer
My actions
|
Also, we don't want to pin dependency versions in the conda recipe to avoid package conflicts. So either way, we would need to address this issue (rather than limit |
The original error
occurs when loading arrays with dask without using But we need a new approach (relative to my last commit) because using
It seems like the only option at the moment is to call @tomvothecoder - do you see a different way of resolving this? |
Originally, the old dev env had xarray v0.17.0, which did not support item assignment at all. Dask was not pinned. https://github.com/pydata/xarray/blob/v0.17.0/xarray/core/indexing.py#L1378-L1385
The dev env now includes xarray v0.19.0 and Dask 2021.9.1. xarray v0.19.0 includes pydata/xarray#5174, which adds supports for just single index item assignment
The actual root cause of the issue is the error,
I think if we use don't use These are the things we've tried, which produced different results.
So far, I only see 3. Use |
Hey @lee1043, can you push the latest changes to your Steve also received this error, and I'm thinking it is from an updated version of |
@tomvothecoder sure, just pushed. I see my numpy version is |
Background info on
|
What versions of software are you using?
master
What are the steps to reproduce this issue?
What happens? Any logs, error output, etc?
The text was updated successfully, but these errors were encountered: