Skip to content
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

Potentially remove support for functions that accept numpy arrays rather than DataArrays #281

Closed
spencerahill opened this issue Jun 12, 2018 · 2 comments

Comments

@spencerahill
Copy link
Owner

(Another potential piece of fat to be trimmed from Calc found while working on #208)

Calc currently has logic for handling when a Var's function consumes numpy arrays rather than xarray.DataArrays. See here. IIRC, the motivation for this was to ease the transition from when we first switched over to a DataArray-based workflow, so that existing functions that used numpy arrays needn't be scrapped. The flag itself is actually an attribute of Var.

However, I have already switched over everything to DataArrays. Does anybody use this? @spencerkclark?

Compared to much of Calc, the logic is actually straightforward, but I still think it fits into the category of non-essential, poorly or not-at-all documented things that I crammed into Calc that would be better off re-implemented properly if/when the need arises. That being said, 100% receptive to keeping it if it's still being used.

(There is also placeholder logic for functions that consume Datasets rather than DataArrays, which likewise seem unnecessary.)

@spencerkclark
Copy link
Collaborator

Yes, by all means remove this! This is quite outdated; I don't use it either. Regardless, with apply_ufunc now in xarray, it is quite straightforward to convert a pure numpy function to one that operates on DataArrays.

@spencerahill
Copy link
Owner Author

Regardless, with apply_ufunc now in xarray, it is quite straightforward to convert a pure numpy function to one that operates on DataArrays.

Great point. OK, will go ahead with this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants