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

What methods does a type need to define to work with DataInterpolations? #156

Open
asinghvi17 opened this issue Mar 24, 2023 · 1 comment

Comments

@asinghvi17
Copy link
Contributor

I recently tried to use Rasters.jl rasters (basically AbstractArrays) with DataInterpolations, only for it to fail.

This turned out to be because it essentially called typeof(input_array)(multiplied_array), which wasn't defined for Rasters in such exactness (Raster(::Raster) was defined, but not with all the type parameters written out).

I defined it and it worked perfectly, but I wanted to understand why this method is called in the first place.
Wouldn't multiplication give you the correct type anyway, or is this for e.g. Float64-Float32 conversion concerns?
If so, since AbstractArrays are typed as AbstractArray{N, T}, would it be possible to just run T.(multiplied_array)?

@ChrisRackauckas
Copy link
Member

This could probably be improved to use a smaller subset of the interfaces, yes. That likely comes down to Rasters missing an ArrayInterface overload and having to use a fallback.

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

No branches or pull requests

2 participants