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

ScheduleDay: new timeseries method and interpolation options #5111

Merged
merged 73 commits into from
Apr 26, 2024

Conversation

joseph-robertson
Copy link
Collaborator

@joseph-robertson joseph-robertson commented Mar 13, 2024

Pull request overview

A new timeSeries() method for returning vectors of times and values given the number of timesteps per hour integer from the Timestep object.

Align the OS and E+ IDDs. The "Interpolate to Timestep" field is now "No", "Average", or "Linear" (i.e., a Breaking Change). The behavior of:

  • "Linear" is unchanged (i.e., still LinearInterp)
  • "No" is HoldNextInterp, and
  • "Average" is a new AverageInterp interpolation on schedule values given the simulation timestep

Update the FT to write the correct method, not just "Average" as it was before.

Pull Request Author

  • Model API Changes / Additions
  • Any new or modified fields have been implemented in the EnergyPlus ForwardTranslator (and ReverseTranslator as appropriate)
  • Model API methods are tested (in src/model/test)
  • EnergyPlus ForwardTranslator Tests (in src/energyplus/Test)
  • If a new object or method, added a test in NREL/OpenStudio-resources: Add Link
  • If needed, added VersionTranslation rules for the objects (src/osversion/VersionTranslator.cpp)
  • Verified that C# bindings built fine on Windows, partial classes used as needed, etc.
  • All new and existing tests passes
  • If methods have been deprecated, update rest of code to use the new methods

Labels:

  • If change to an IDD file, add the label IDDChange
  • If breaking existing API, add the label APIChange
  • If deemed ready, add label Pull Request - Ready for CI so that CI builds your PR

Review Checklist

This will not be exhaustively relevant to every PR.

  • Perform a Code Review on GitHub
  • Code Style, strip trailing whitespace, etc.
  • All related changes have been implemented: model changes, model tests, FT changes, FT tests, VersionTranslation, OS App
  • Labeling is ok
  • If defect, verify by running develop branch and reproducing defect, then running PR and reproducing fix
  • If feature, test running new feature, try creative ways to break it
  • CI status: all green or justified

@joseph-robertson joseph-robertson added component - Model Pull Request - Ready for CI This pull request if finalized and is ready for continuous integration verification prior to merge. labels Mar 13, 2024
@joseph-robertson joseph-robertson self-assigned this Mar 13, 2024
@joseph-robertson joseph-robertson changed the title ScheduleDay: new getValues method ScheduleDay: new getTimes and getValues methods Mar 14, 2024
src/model/ScheduleDay.hpp Outdated Show resolved Hide resolved
@joseph-robertson joseph-robertson changed the title ScheduleDay: new getTimes and getValues methods ScheduleDay: new timeseries method and interpolation options Mar 21, 2024
return value;
}

openstudio::TimeSeries ScheduleDay_Impl::timeSeries() const {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This returns timeseries with timestamps (i.e., a DateTimeVector) that align with the Timestep object. The values returned (i.e., a Vector) correspond to the "Interpolate to Timestep" choice.

src/model/ScheduleDay.cpp Outdated Show resolved Hide resolved
@joseph-robertson joseph-robertson added the APIChange A motivated non-backward compatible change that breaks the existing API and needs to be communicated label Mar 25, 2024
@jmarrec
Copy link
Collaborator

jmarrec commented Apr 25, 2024

@joseph-robertson Thanks for addressing some of the review comments.

I'm still not happy about getValue, and maybe we should open a ticket to revisit the getValue and avoid recomputing the entire day, but maybe not.

Anyways, if CI is happy with this, we can merge.

@jmarrec
Copy link
Collaborator

jmarrec commented Apr 25, 2024

/srv/jenkins/openstudio/docker-volumes/ubuntu-2004/Openstudio/src/utilities/data/Vector.cpp:103:7: error: ‘OS_ASSERT’ was not declared in this scope; did you mean ‘BOOST_ASSERT’?

fixed in 012f076

src/utilities/data/Vector.cpp Outdated Show resolved Hide resolved
@jmarrec jmarrec merged commit 2887061 into develop Apr 26, 2024
3 of 6 checks passed
@jmarrec jmarrec deleted the dayschedule-getvalues branch April 26, 2024 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
APIChange A motivated non-backward compatible change that breaks the existing API and needs to be communicated component - Model Pull Request - Ready for CI This pull request if finalized and is ready for continuous integration verification prior to merge.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ScheduleDay::getValue applies interpolation differently than EnergyPlus
4 participants