Skip to content

Comments

Address #4630, wrap Output:Schedules and Output:Constructions objects#4685

Merged
jmarrec merged 15 commits intodevelopfrom
output-schs-constrs
Sep 28, 2022
Merged

Address #4630, wrap Output:Schedules and Output:Constructions objects#4685
jmarrec merged 15 commits intodevelopfrom
output-schs-constrs

Conversation

@joseph-robertson
Copy link
Collaborator

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: 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 Enhancement Request component - Model Pull Request - Ready for CI This pull request if finalized and is ready for continuous integration verification prior to merge. labels Sep 16, 2022
@joseph-robertson joseph-robertson self-assigned this Sep 16, 2022
@joseph-robertson joseph-robertson mentioned this pull request Sep 16, 2022
17 tasks
Copy link
Collaborator

@jmarrec jmarrec left a comment

Choose a reason for hiding this comment

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

A straightforward addition. Use a const string&, test that having a blank line in the Output:Constructions object is fine, and it should be good

Comment on lines +3310 to +3320
result.push_back(IddObjectType::OS_Output_Schedules);
result.push_back(IddObjectType::OS_Output_Constructions);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, need to always FT them

Comment on lines 34114 to 34132
OS:Output:Constructions,
\memo Adds a report to the eio output file which shows details for each construction,
\memo including overall properties, a list of material layers, and calculated results
\memo related to conduction transfer functions.
\format singleLine
\unique-object
A1, \field Handle
\type handle
\required-field
A2, \field Constructions
\type choice
\required-field
\key No
\key Yes
A3; \field Materials
\type choice
\required-field
\key No
\key Yes
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks a lot for using a sane IDD object unlike the E+ object which is rather weird.

For reference the E+ object is like this:

Output:Constructions,
        \memo Adds a report to the eio output file which shows details for each construction,
        \memo including overall properties, a list of material layers, and calculated results
        \memo related to conduction transfer functions.
  \format singleLine
   A1,  \field Details Typte 1
   \type choice
   \key Constructions
   \key Materials
   A2;  \field Details Type 2
   \type choice
   \key Constructions
   \key Materials

Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe Report For Constructions would be clearer. But I don't really care.

Comment on lines 55 to 62
if (modelObject.constructions()) {
idfObject.setString(Output_ConstructionsFields::DetailsType1, "Constructions");
}

if (modelObject.materials()) {
idfObject.setString(Output_ConstructionsFields::DetailsType2, "Materials");
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Have you tested whether this works when you have Constructions = No and Materials = yes? This leads to this IDF object:

Output:Constructions,
  ,                  !- Details Type 1
  Materials;   !- Details Type 2

Comment on lines 46 to 51
// If nothing to write, don't
bool constructions = modelObject.constructions();
bool materials = modelObject.materials();
if (!constructions && !materials) {
return boost::none;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I assume E+ is unhappy if you end up with a blank object?

Comment on lines 63 to 64
if (result.empty()) {
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
if (result.empty()) {
}

/** @name Setters */
//@{

bool setKeyField(std::string keyField);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
bool setKeyField(std::string keyField);
bool setKeyField(const std::string& keyField);

Comment on lines 113 to 114
bool ok = setConstructions(true);
OS_ASSERT(ok);
ok = setMaterials(false);
OS_ASSERT(ok);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Makes sense to me to at least enable one

if (boost::optional<std::string> _detailsType1 = workspaceObject.getString(Output_ConstructionsFields::DetailsType1, true)) {
if (istringEqual("Constructions", _detailsType1.get())) {
modelObject.setConstructions(true);
} else if (istringEqual("Materials", _detailsType1.get()) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

build error here, missing a closing )

@jmarrec jmarrec marked this pull request as ready for review September 28, 2022 11:41
@jmarrec jmarrec force-pushed the output-schs-constrs branch from a5d984f to c30da65 Compare September 28, 2022 11:41
jmarrec added a commit to NatLabRockies/OpenStudio-resources that referenced this pull request Sep 28, 2022
…ut_objects

This will NOT affect EUI in any way so it's fine to add it there.

Companion PR: NatLabRockies/OpenStudio#4685
@ci-commercialbuildings
Copy link
Collaborator

ci-commercialbuildings commented Sep 28, 2022

CI Results for eab1c24:

@jmarrec jmarrec merged commit 515b977 into develop Sep 28, 2022
@jmarrec jmarrec deleted the output-schs-constrs branch September 28, 2022 12:50
@jmarrec
Copy link
Collaborator

jmarrec commented Sep 28, 2022

I wrapped up the PR, added a test on NatLabRockies/OpenStudio-resources#183. Ubuntu is happy, so is my extensive local testing. merging

Sign up for free to join this conversation on GitHub. Already have an account? Sign in 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.

Wrap Output:Schedules and Output:Constructions objects

3 participants