-
Notifications
You must be signed in to change notification settings - Fork 14
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
Pangeo TEM example #145
Comments
Here's a jupyter notebook: https://github.com/tomwhite/cubed/blob/f5ece5b068db014f828bf6f3afcf6b05280af52a/examples/pangeo-tem.ipynb There are a couple of pieces missing. The first is fairly minor, and is that The main thing that's missing is a Cubed-compatible path for xarray |
Yes you'll want We'll also want to support cubed in flox, which should be mostly easy since I'm using {
"groups": np.array([1, 2, 3, 4]) # shape (ngroups,)
"intermediates": (np.array([4,5,6,7]), np.array([1, 1, 1, 1])) # so tuple(sum, counts) with shape (..., ngroups)
} for the That said, for this particular problem I could write the groupby as an efficient indexing + reduction. That's probably better since we'll have a "pure array" version of the problem, which will be easy for experimentation and comparison across libraries |
Thanks @dcherian. For intermediates, Cubed uses structured arrays (e.g.
Agree that would be good. Although we'll probably need to add integer array indexing to Cubed - see data-apis/array-api#177 for a bit of discussion about that from a standardisation point of view. |
I've added integer array indexing (and I've update the example notebook at https://github.com/tomwhite/cubed/blob/5eb5f23c25c37ec8634eb35a71711f4eaaffd643/examples/pangeo-tem.ipynb (this needed a few xarray changes). It doesn't use Flox group by yet though. |
This issue is to explore running the "Transformed Eulerian Mean diagnostic" example in https://github.com/dcherian/ncar-challenge-suite/blob/main/tem.ipynb using Cubed.
It uses Xarray, so needs pydata/xarray#7019
The text was updated successfully, but these errors were encountered: