-
-
Notifications
You must be signed in to change notification settings - Fork 713
Enhance Data Retrieval Accuracy with MatchType in TimeseriesRef #969
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
base: main
Are you sure you want to change the base?
Conversation
look at CI... |
- Added an enumeration MatchType with options Exact and Nearest. - Modified atTime and getRawIndexAtTime in TimeseriesRef to support MatchType, allowing callers to specify whether they need an exact timestamp match or the nearest available match. - Adjusted the atTime method to throw an error when an exact match is required but not found, enhancing error handling for strict match requirements.
I have resolved the compilation issues. However, I have a question regarding the proposal to pass an enum class |
@@ -25,7 +31,10 @@ struct TimeseriesRef | |||
|
|||
void set(unsigned index, double x, double y); | |||
|
|||
double atTime(double t) const; | |||
double atTime(double t, MatchType match_type) const; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding new argument breaks older scripts. The best way it should be a default value but ain't sure it's possible with lua.
Maybe you should define standalone functions like Uncle bob once said. In this way you should add three functions:
|
This MR introduces the
MatchType
enumeration toTimeseriesRef
, providing the option to choose between exact and nearest time matching. Changes include updates to theatTime
andgetRawIndexAtTime
methods to support this new functionality.For a detailed problem description see: #968