Skip to content

Cast inputs to Cubed arrays in apply_ufunc #551

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

Merged
merged 2 commits into from
Aug 14, 2024
Merged

Conversation

tomwhite
Copy link
Member

No description provided.

from cubed.array_api.creation_functions import asarray

specs = [a.spec for a in args if hasattr(a, "spec")]
spec = specs[0] if len(specs) > 0 else None
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should multiple different specs error? Or specs with different values for the allowed memory and intermediate directory. Otherwise isn't it possible to get some confusing behaviour where it isn't super clear which memory configuration and output directory is being used?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This actually gets checked later when constructing the plan (all specs have to be the same), but I should add a comment to explain that.

@tomwhite tomwhite merged commit 19edd81 into main Aug 14, 2024
10 of 11 checks passed
@tomwhite tomwhite deleted the asarray-in-apply-gufunc branch August 14, 2024 09:07
thodson-usgs pushed a commit to thodson-usgs/cubed that referenced this pull request Oct 24, 2024
* Cast inputs to Cubed arrays in `apply_ufunc`

* Add comment about specs being the same
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants