Closed DanDeepPhase closed 3 months ago
Yeah that's how it works, you can only add to function defined somewhere else, you can't "see" functions or types created inside the extension.
Returning an interpolator is probably a better strategy too.
I trimmed it down a lot. The code is pretty straightforward now. Perhaps it should extend interpolate, but i tend to use the convenience functions more.
For future effort, i could see two nice to have functions:
not super good with CI, seemed like a compat issue, but it didn't resolve when i added interpolations to the compat list.
Sorry was too busy with other things. The Project.toml file is broken, you need an equals sign for the Interpolations version here:
https://github.com/rafaqz/DimensionalData.jl/actions/runs/7786303160/job/21230819886#step:4:46
Attention: Patch coverage is 0%
with 4 lines
in your changes are missing coverage. Please review.
:exclamation: No coverage uploaded for pull request base (
interpolations@06b5cd7
). Click here to learn what that means.
Files | Patch % | Lines |
---|---|---|
ext/DimensionalDataInterpolations.jl | 0.00% | 4 Missing :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
I wonder if this could also use the DimensionalData Makie utility functions...it seems like one would want to shift indices to sample at the center and similar things when interpolating by default.
I do wish that Interpolations.jl respected the array axis interface, but I guess that would be a pretty annoying thing to do and would have to be upstream in any case. That being said, for full compatibility we should also be overriding like:
Interpolations.interpolate(A::AbstractDimArray, interpmode; kw...) = Interpolations.interpolate(DimensionalData.index(dims(A)), A; kw...)
or something, to provide general support.
Just realised this PR was against the other PR, so I'll reopen it
This implements a general linear interpolation. Summary:
I commented out your existing code because it was failing for me in a few ways. I don't really understand extensions, so could be easy fixes.