GridInterpolations.jl icon indicating copy to clipboard operation
GridInterpolations.jl copied to clipboard

Grid with Dates

Open StepanSushko opened this issue 3 years ago • 1 comments

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.

StepanSushko avatar Nov 11 '22 18:11 StepanSushko

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.

mykelk avatar Nov 12 '22 19:11 mykelk