Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Addresses #4380, completing SDK support of Tubular Daylighting Devices (TDDs) #4382

Merged
merged 35 commits into from
Aug 18, 2021

Conversation

joseph-robertson
Copy link
Collaborator

@joseph-robertson joseph-robertson commented Jul 23, 2021

Pull request overview

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: Addresses #4380, completing SDK support of Tubular Daylighting Devices (TDDs) OpenStudio-resources#149
  • 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 self-assigned this Jul 23, 2021
@joseph-robertson joseph-robertson added IDDChange Pull Request - Ready for CI This pull request if finalized and is ready for continuous integration verification prior to merge. and removed IDDChange labels Jul 23, 2021
Comment on lines +62 to +63
explicit DaylightingDeviceTubular(const SubSurface& dome, const SubSurface& diffuser, const ConstructionBase& construction, double diameter,
double totalLength, double effectiveThermalResistance);
Copy link
Collaborator

Choose a reason for hiding this comment

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

This Ctor isn't needed. The one below is enough. you can call the setters for the numeric fields. If you had zero idea about providing a default for these (that's not the case since you made one where you default them), then it would have been required to make this one.
The one is tricky to use too because it's easy to mix up the order of the double arguments.
Also, that means more code to maintain and test.

That being said, if you feel strongly you find it useful, you can leave it.

boost::optional<DaylightingDeviceShelf> shelf = this->daylightingDeviceShelf();
if (shelf) {
if (boost::optional<DaylightingDeviceShelf> shelf = this->daylightingDeviceShelf()) {
LOG(Warn, briefDescription() << " new subSurfaceType='" << subSurfaceType << "' is incompatible with Daylighting Device Shelf. Removing the Shelf object.");
Copy link
Collaborator

Choose a reason for hiding this comment

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

FYI I changed the messages in this file @joseph-robertson

EXPECT_EQ("Door", door.subSurfaceType());
EXPECT_EQ(0, model.getConcreteModelObjects<DaylightingDeviceLightWell>().size());

EXPECT_ANY_THROW({DaylightingDeviceLightWell lightWell(door);});
Copy link
Collaborator

Choose a reason for hiding this comment

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

@joseph-robertson note that gtest has macros for that. EXPECT/ASSERT_ANY/NO_THROW are the most common. You could also do EXPECT_THROW(..., openstudio::Exception) if you want a specific exception

@jmarrec
Copy link
Collaborator

jmarrec commented Aug 18, 2021

I made minor changes to what is otherwise a nice clean PR. Will tel CI churn, then make sure the NREL/OpenStudio-resources#149 is still passing. And that this can merge

@ci-commercialbuildings
Copy link
Collaborator

ci-commercialbuildings commented Aug 18, 2021

CI Results for 503e955:

@jmarrec
Copy link
Collaborator

jmarrec commented Aug 18, 2021

I'm happy about this PR. The Reg test should be adjusted but that can happen in a second pass.

@jmarrec jmarrec merged commit 5193dd1 into develop Aug 18, 2021
@jmarrec jmarrec deleted the issue-4380 branch August 18, 2021 11:02
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
component - Model Enhancement Request 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.

Completing SDK support of Tubular Daylighting Devices (TDDs)
3 participants