-
Notifications
You must be signed in to change notification settings - Fork 422
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
precipitable_water with xarray objects throws dimension error in rc2 #1603
Comments
I am using Xarray 0.16.1 but it looks like the info below is the same for 0.16.2 also. Digging into the traceback further leads me to Xarray, in dataarray.py from
Here, the shape of my precipitable water value (2.5675617212748807 millimeter) must be zero, while the number of dims is 1. It looks like the type of object that's being passed into dims is ('level',) and shape is empty () on the pint quantity object. Xarray is using "data.shape" to pass into |
Interesting that when I try to access the I am not sure why the Xarray code does not throw that error though, when they are attempting to pass |
I assume I don't get the attribute error from Xarray, because they are doing some massaging of the data prior to calling
|
Thanks for the error report and catching this before 1.0 final! It looks like I mistakenly set |
No problem! I verified your suggestion fixed my issue. I will work on a PR shortly. Could you provide your thoughts on the additional error I am getting from
|
That would great if you were able to work on a PR for that! I'm not totally sure what is going wrong with |
Should I look further into the errors from |
Sorry for the delayed follow-up, but yes, it may still be good to look into the errors from |
No problem. I took a deeper look at
If args is an array, how would I structure it in the call to However when I look at what the |
Just FYI, I'm about to put in a PR to fix |
PR with fixes for both incoming... Thanks for reporting @DanielAdriaansen. This report, and your testing with the rc's, helped eliminate a couple bugs in 1.0 final! |
Just an oops in how it was decorated.
No problem at all! Glad I was able to at least hone in on the potential problem area with |
Thanks! Your detective work there made it much easier to find and fix. |
Something changed from rc1 to rc2 that caused my code calculating precipitable water to break. Here is the traceback:
I did some very light debugging inside xarray.py, and my best guess is that since precipitable water is an integrated quantity from 3D fields, there is a mis-match where the value returned is a single float but the input data have length of num_levels? I am going to try and do some differencing of rc1 vs rc2 xarray.py file and see if that might provide some further insight.
I printed the input and both ds['P'].isel(latitude=x,longitude=y) and ds['TD'].isel(latitude=x,longitude=y) have the same shape and size and bottom and top are just floats as input to
precipitable_water()
.The text was updated successfully, but these errors were encountered: