NREL / OpenStudio

OpenStudio is a cross-platform collection of software tools to support whole building energy modeling using EnergyPlus and advanced daylight analysis using Radiance.
https://www.openstudio.net/
Other
486 stars 186 forks source link

ScheduleDay: new timeseries method and interpolation options #5111

Closed joseph-robertson closed 3 months ago

joseph-robertson commented 4 months ago

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:

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

Pull Request Author

Labels:

Review Checklist

This will not be exhaustively relevant to every PR.

eringold commented 4 months ago

Although this PR contains an API breaking change, I believe the negative impacts should be fairly minimal. The primary API changes are:

In openstudio-standards, ComStock and a few measure repos I've looked at, there are many uses of ScheduleDay::getValue, but the only uses of ScheduleDay::setInterpolateToTimestep are to set as false (with one exception, which is the use in openstudio-standards from which I identified this issue, but which I removed because it was not needed). Since the default ScheduleDay interpolation method is 'none', all the existing uses of getValue would be unaffected by these changes.

Adding the appropriate options to setInterpolateToTimestep and the Average interpolation calculation is an improvement in that it aligns the OpenStudio user experience with how EnergyPlus interprets that input, and the addition of the ScheduleDay::timeSeries method adds further utility to users in processing of schedules, such as in equivalent full-load hour calculations and parametric schedule modifications.

In short, these are good and necessary changes. Thanks @joseph-robertson!

jmarrec commented 3 months ago

@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 commented 3 months ago
/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 012f076b8476fb752e849672bc1b2f1bb08f6843

ci-commercialbuildings commented 3 months ago

CI Results for 7493115cf7e447813cf444592b7a284837bb1a0a: