fix!: change Series.getValueAtTime to work with non-1 save frequency #293
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #259
BREAKING-CHANGE: This renames Outputs timeStart/timeEnd to startTime/endTime and adds a saveFreq argument (defaults to 1).
This primarily fixes an issue with
Series.getValueAtTime
where it previously assumed that the output data had a save frequency (SAVEPER
) of 1. It now handles arbitrary save frequency values, and does a linear search instead of assuming that it can jump to a particular index. (Binary search can come later.)To make this work, I added a
saveFreq
argument to theOutputs
constructor. While I was at it, I renamed thetimeStart
andtimeEnd
fields onOutputs
to bestartTime
andendTime
to be consistent with other uses. (These fields aren't typically accessed but will remain public, and thus the breaking change.)Note that the rest of the runtime and build packages still need more work to handle non-1
SAVEPER
values. That work will be completed soon under separate issue #291.BEGIN_COMMIT_OVERRIDE
fix!: change Series.getValueAtTime to work with non-1 save frequency
BREAKING-CHANGE: The
timeStart
andtimeEnd
properties in theOutputs
class in the@sdeverywhere/runtime
package have been renamed tostartTime
andendTime
, and there is an additionalsaveFreq
argument for theOutputs
constructor (which defaults to 1).END_COMMIT_OVERRIDE