Skip to content

Add interpolator field to TimeSeries#23

Merged
tuckermcclure merged 3 commits into
mainfrom
tucker/interpolator
Apr 28, 2026
Merged

Add interpolator field to TimeSeries#23
tuckermcclure merged 3 commits into
mainfrom
tucker/interpolator

Conversation

@tuckermcclure
Copy link
Copy Markdown
Member

We've talked about this, and here it is. It's very simple, and that's the goal. It also has a useful default. I tested that this powers our downstream packages with no changes.

@CarlOlsson
Copy link
Copy Markdown
Member

Two questions

  1. If we specify an non default interpolator on a time series ts1, save it to hdf5 and then load it again as ts2, will the loaded time series still evaluate to the same, ie. is ts1(0.5) == ts2(0.5)

  2. I am wondering about the custom interpolator with states. Say an interpolator returns linear interpolation plus 10. Now ts(1:0.1:10) will retrun ts_linear_interp(1:0.1:10) .+ 10. That is good but what happens for ts2 = ts(1:0.1:10), ts3 = ts2(3.0:0.1:4.0). This will again add 10?

@tuckermcclure
Copy link
Copy Markdown
Member Author

Right now, if you save the logs to HDF5 and then load them, the interpolator information is lost. I think we should add that. I did not opt to add that in this PR, but I would do that soon. The way I would do it is that I would serialize the whole interpolator and deserialize it on load. This is not flexible. To use the log in the future, you'd have to have the same interpolator defined. That's already true for a bunch of the types that are serialized though, so I'm not too worried about the portability of the interpolator. Would you want that as a feature of this PR, or is a follow-up PR a better place for that?

@CarlOlsson
Copy link
Copy Markdown
Member

All good, just wanted to make sure we didn't miss anything.

@tuckermcclure tuckermcclure merged commit 0f40af6 into main Apr 28, 2026
3 checks passed
@tuckermcclure tuckermcclure deleted the tucker/interpolator branch April 28, 2026 16:36
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