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

Add missing add_result_measure_info so that out.osw step result have the same info as before #5044

Merged
merged 2 commits into from
Nov 16, 2023

Conversation

jmarrec
Copy link
Collaborator

@jmarrec jmarrec commented Nov 15, 2023

Pull request overview

Found because the OS-resources tests rely on it to locate openstudio_results

Left is 3.6.1, Right is the C++ CLI:

image

After: same

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

Found because the OS-resources tests rely on it to locate openstudio_results
@jmarrec jmarrec added component - Workflow Pull Request - Ready for CI This pull request if finalized and is ready for continuous integration verification prior to merge. labs labels Nov 15, 2023
@jmarrec jmarrec self-assigned this Nov 15, 2023
@jmarrec jmarrec requested a review from kbenne November 15, 2023 23:00
Comment on lines +332 to +350
bool addResultMeasureInfo(WorkflowStepResult& result, BCLMeasure& measure) {
try {
result.setMeasureType(measure.measureType());
result.setMeasureName(measure.name());
result.setMeasureId(measure.uid());
result.setMeasureVersionId(measure.versionId());
auto version_modified_ = measure.versionModified();
if (version_modified_) {
result.setMeasureVersionModified(*version_modified_);
}
result.setMeasureXmlChecksum(measure.xmlChecksum());
result.setMeasureClassName(measure.className());
result.setMeasureDisplayName(measure.displayName());
result.setMeasureTaxonomy(measure.taxonomyTag());
return true;
} catch (...) {
return false;
}
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@@ -84,6 +84,7 @@ void OSWorkflow::applyMeasures(MeasureType measureType, bool energyplus_output_r
LOG(Info, fmt::format("Skipping measure '{}'", measureDirName));
WorkflowStepResult result = runner.result();
runner.incrementStep();
// addResultMeasureInfo(result, bclMeasure); // TODO: Should I really instantiate the BCLMeasure just for this?
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

When Skip, I'm not doing it. I think that's fine.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

New test before/after

@jmarrec jmarrec merged commit 37087fd into develop Nov 16, 2023
5 of 6 checks passed
@jmarrec jmarrec deleted the add_result_measure_info branch November 16, 2023 02:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component - Workflow labs 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.

2 participants