-
Notifications
You must be signed in to change notification settings - Fork 9
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
What about an xarray extension? #37
Comments
Hi @aulemahal, that sounds like a really nice approach. I didn't realise |
@agstephens It would be great to address this issue in our upcoming meeting. I'd love to see this as an optional way of calling |
Yes @Zeitsperre, let's talk about this. It seems straightforward. |
This would, indeed, be easy to create:
|
This could be automatically maintained by doing picking up the external functions list from relevant modules and creating lambdas for each:
So it looks very easy to do. The question is: should this be the public API that we expose? Any thoughts: @huard @Zeitsperre @cehbrecht @ellesmith88 ? |
I don't have a strong opinion either way. I certainly think it's worth experimenting with. |
I realize that this is still in the planning stage, but it looks like |
Packages like
rioxarray
orhvplot
, provide an xarray extension so their methods can be called directly on the dataset. Would that be wanted withclisops
?Example: instead of
one could use:
Where "cso" is the xarray extension added by
clisops
.Personally, I like this approach as it looks more elegant and xarray-esque. Moreover, it could allow for dataset-related lookups like crs info in metadata or using something like rioxarray's
ds.rio.set_spatial_dims
to solve the problem of #32.Implementation-wise, it shouldn't be complicated and wouldn't change the rest of the api, simply add another access mechanism.
And, I believe it would make clisops more attractive to xarray users!
As a heavy user of almost-extinct
xclim.subset
, I can offer some time on this implementation, it it is wanted.The text was updated successfully, but these errors were encountered: