Skip to content
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

fix!: change Series.getValueAtTime to work with non-1 save frequency #293

Merged
merged 2 commits into from
Dec 9, 2022

Conversation

chrispcampbell
Copy link
Contributor

@chrispcampbell chrispcampbell commented Dec 9, 2022

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 the Outputs constructor. While I was at it, I renamed the timeStart and timeEnd fields on Outputs to be startTime and endTime 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 and timeEnd properties in the Outputs class in the @sdeverywhere/runtime package have been renamed to startTime and endTime, and there is an additional saveFreq argument for the Outputs constructor (which defaults to 1).
END_COMMIT_OVERRIDE

BREAKING-CHANGE: This renames Outputs timeStart/timeEnd to startTime/endTime and adds a saveFreq argument (defaults to 1).
@chrispcampbell chrispcampbell merged commit ba510b0 into main Dec 9, 2022
@chrispcampbell chrispcampbell deleted the chris/259-get-value-at-time branch December 9, 2022 18:51
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.

getValueAtTime may return incorrect value
1 participant