Allow basic xarray commands to be applied to whole PredictionEnsemble object
See original GitHub issueI think it would be extremely useful to be able to call something like ReferenceEnsemble.sel(time=slice(1980, 2000))
and have it apply to every product (e.g., reconstruction, data, uninitialized run).
Some commands I’d like to implement:
sel()
isel()
squeeze()
groupyby()
rolling()
resample()
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
xarray.DataArray
Coerces wrapped data and coordinates into numpy arrays, returning a DataArray. assign_attrs (*args, **kwargs). Assign new attrs to this object.
Read more >xarray.apply_ufunc
Apply a vectorized function for unlabeled arrays on xarray objects. The function will be mapped over the data variable(s) of the input arguments...
Read more >xarray.Dataset
Assign new data variables to a Dataset, returning a new object with all the original variables in ... Apply a function to each...
Read more >Applying unvectorized functions with apply_ufunc - Xarray
Apply a vectorized function for unlabeled arrays on xarray objects. The function will be mapped over the data variable(s) of the input arguments...
Read more >Data Structures - Xarray
xarray.DataArray is xarray's implementation of a labeled, multi-dimensional array. It has several key properties: ... Xarray uses dims and coords to enable its ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I had strong objections about introducing such things after two weeks.
@ahuang11 – thanks for the clarifications. I figured there were alleviations for all points but wanted to see what you had to say. I think accessor is the way to go, and maybe that’s the major focus for the v2 rollout that you and I can focus on. I am particularly happy to hear we can rewrite as cp = ClimPred(ds) for instance.
I agree 100%. This forced me to learn python classes anyhow so I’m not mad. Let’s put a pin in this for now and pick it up in a conference call following v1’s completion. For now, we can have the classes access our updated functions (which shouldn’t require change) and then will do a rewrite “early on” to switch to accessors.
Agreed. My comment was more about comparisons and so on. But we can alleviate that by forcing a
ds.type
attribute on intiialization.Good conversation! Excited to dig into this. Appropriately implementing this will put the package in the place I really want to see it… with smart easy-to-use objects and methods.