OpenStudio is a cross-platform collection of software tools to support whole building energy modeling using EnergyPlus and advanced daylight analysis using Radiance.
Swig T boost::optional<T>::value_or(T default_value). I think the semantics is nice.
This allows you to write something like
def get_optional(is_initialized)
is_initialized ? OpenStudio::OptionalDouble.new(10.0) : OpenStudio::OptionalDouble.new()
end
val = get_optional(true).value_or(20.0)
raise unless val == 10.0
val = get_optional(false).value_or(20.0)
raise unless val == 20.0
Pull Request Author
[x] Model API Changes / Additions
[ ] Any new or modified fields have been implemented in the EnergyPlus ForwardTranslator (and ReverseTranslator as appropriate)
[x] 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
Pull request overview
Swig
T boost::optional<T>::value_or(T default_value)
. I think the semantics is nice.This allows you to write something like
Pull Request Author
src/model/test
)src/energyplus/Test
)src/osversion/VersionTranslator.cpp
)Labels:
IDDChange
APIChange
Pull Request - Ready for CI
so that CI builds your PRReview Checklist
This will not be exhaustively relevant to every PR.