sisl / GridInterpolations.jl

Multidimensional grid interpolation in arbitrary dimensions
Other
52 stars 12 forks source link

Grid with Dates #39

Open StepanSushko opened 1 year ago

StepanSushko commented 1 year ago

I tried to create a RectangleGrid(t,p), where t is a Date, p is a float with no luck, I got error "ERROR: MethodError: Cannot convert an object of type Date to an object of type Float64". Is there way to resolve it?

I tried to redefine RectangleGrid struct, but I also failed with it at the moment.

mykelk commented 1 year ago

Yeah, as you can see in: https://github.com/sisl/GridInterpolations.jl/blob/master/src/GridInterpolations.jl the cutpoints are converted into Float64. There are two options: (1) put together a PR that generalizes the cutpoints, but this might be tricky, or (2) do your interpolation with floats and then convert between floats and dates externally from this package.