-
Notifications
You must be signed in to change notification settings - Fork 222
#4830 - Add a new ReportingMeasure::modelOutputRequests(model, runner, argument_map) that runs before E+ FT #5367
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
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
32229d1
Add ReportingMeasure::modelOutputRequests
jmarrec b507d62
For backward compatibility, we need a way to test if a measure has a …
jmarrec 1a790d3
Make the modelOutputRequests run in workflow right after the ModelMea…
jmarrec 4fa064a
Update BCL template for ReportingMeasure + tests to have modelOutputR…
jmarrec 6d27b38
Add a failing test for hasMethod
jmarrec a798f8e
Ok, implement hasMethod with a overriden_only = true param.
jmarrec 9460310
Add a ctest via pytest that will run one reportingMeasure with and on…
jmarrec 6eac3be
Do NOT return False in energyPlusOutputRequest when something goes wr…
jmarrec efe63f2
I botched my measures doing copy paste
jmarrec 90c936a
clang format
jmarrec 678ee71
Shush cppcheck
jmarrec File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
python/engine/test/ReportingMeasureWithModelOutputs/measure.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| """insert your copyright here. | ||
|
|
||
| # see the URL below for information on how to write OpenStudio measures | ||
| # http://nrel.github.io/OpenStudio-user-documentation/reference/measure_writing_guide/ | ||
| """ | ||
|
|
||
| from pathlib import Path | ||
|
|
||
| import openstudio | ||
|
|
||
|
|
||
| class ReportingMeasureWithModelOutputs(openstudio.measure.ReportingMeasure): | ||
| """An ReportingMeasure.""" | ||
|
|
||
| def name(self): | ||
| return "ReportingMeasureWithModelOutputs" | ||
|
|
||
| def description(self): | ||
| return "DESCRIPTION_TEXT" | ||
|
|
||
| def modeler_description(self): | ||
| return "MODELER_DESCRIPTION_TEXT" | ||
|
|
||
| def arguments(self, model: openstudio.model.Model): | ||
| args = openstudio.measure.OSArgumentVector() | ||
| return args | ||
|
|
||
| def outputs(self): | ||
| outs = openstudio.measure.OSOutputVector() | ||
| return outs | ||
|
|
||
| def modelOutputRequests( | ||
| self, | ||
| model: openstudio.model.Model, | ||
| runner: openstudio.measure.OSRunner, | ||
| user_arguments: openstudio.measure.OSArgumentMap, | ||
| ) -> bool: | ||
| return True | ||
|
|
||
| def energyPlusOutputRequests( | ||
| self, runner: openstudio.measure.OSRunner, user_arguments: openstudio.measure.OSArgumentMap | ||
| ): | ||
| result = openstudio.IdfObjectVector() | ||
| return result | ||
|
|
||
| def run( | ||
| self, | ||
| runner: openstudio.measure.OSRunner, | ||
| user_arguments: openstudio.measure.OSArgumentMap, | ||
| ): | ||
| super().run(runner, user_arguments) | ||
| return True |
44 changes: 44 additions & 0 deletions
44
python/engine/test/ReportingMeasureWithModelOutputs/measure.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| <?xml version="1.0"?> | ||
| <measure> | ||
| <schema_version>3.1</schema_version> | ||
| <name>reporting_measure_with_model_outputs</name> | ||
| <uid>9971eb7b-3225-4795-9690-9941a7471ce0</uid> | ||
| <version_id>be88754a-3d7f-433e-9912-94a2993c9463</version_id> | ||
| <version_modified>2025-03-14T13:15:30Z</version_modified> | ||
| <xml_checksum>1DA817AF</xml_checksum> | ||
| <class_name>ReportingMeasureWithModelOutputs</class_name> | ||
| <display_name>ReportingMeasureWithModelOutputs</display_name> | ||
| <description>DESCRIPTION_TEXT</description> | ||
| <modeler_description>MODELER_DESCRIPTION_TEXT</modeler_description> | ||
| <arguments /> | ||
| <outputs /> | ||
| <provenances /> | ||
| <tags> | ||
| <tag>Reporting.QAQC</tag> | ||
| </tags> | ||
| <attributes> | ||
| <attribute> | ||
| <name>Measure Type</name> | ||
| <value>ReportingMeasure</value> | ||
| <datatype>string</datatype> | ||
| </attribute> | ||
| <attribute> | ||
| <name>Measure Language</name> | ||
| <value>Python</value> | ||
| <datatype>string</datatype> | ||
| </attribute> | ||
| </attributes> | ||
| <files> | ||
| <file> | ||
| <version> | ||
| <software_program>OpenStudio</software_program> | ||
| <identifier>3.9.0</identifier> | ||
| <min_compatible>3.9.0</min_compatible> | ||
| </version> | ||
| <filename>measure.py</filename> | ||
| <filetype>py</filetype> | ||
| <usage_type>script</usage_type> | ||
| <checksum>CFB17771</checksum> | ||
| </file> | ||
| </files> | ||
| </measure> |
44 changes: 44 additions & 0 deletions
44
python/engine/test/ReportingMeasureWithoutModelOutputs/measure.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| """insert your copyright here. | ||
|
|
||
| # see the URL below for information on how to write OpenStudio measures | ||
| # http://nrel.github.io/OpenStudio-user-documentation/reference/measure_writing_guide/ | ||
| """ | ||
|
|
||
| from pathlib import Path | ||
|
|
||
| import openstudio | ||
|
|
||
|
|
||
| class ReportingMeasureWithoutModelOutputs(openstudio.measure.ReportingMeasure): | ||
| """An ReportingMeasure.""" | ||
|
|
||
| def name(self): | ||
| return "ReportingMeasureWithoutModelOutputs" | ||
|
|
||
| def description(self): | ||
| return "DESCRIPTION_TEXT" | ||
|
|
||
| def modeler_description(self): | ||
| return "MODELER_DESCRIPTION_TEXT" | ||
|
|
||
| def arguments(self, model: openstudio.model.Model): | ||
| args = openstudio.measure.OSArgumentVector() | ||
| return args | ||
|
|
||
| def outputs(self): | ||
| outs = openstudio.measure.OSOutputVector() | ||
| return outs | ||
|
|
||
| def energyPlusOutputRequests( | ||
| self, runner: openstudio.measure.OSRunner, user_arguments: openstudio.measure.OSArgumentMap | ||
| ): | ||
| result = openstudio.IdfObjectVector() | ||
| return result | ||
|
|
||
| def run( | ||
| self, | ||
| runner: openstudio.measure.OSRunner, | ||
| user_arguments: openstudio.measure.OSArgumentMap, | ||
| ): | ||
| super().run(runner, user_arguments) | ||
| return True |
44 changes: 44 additions & 0 deletions
44
python/engine/test/ReportingMeasureWithoutModelOutputs/measure.xml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| <?xml version="1.0"?> | ||
| <measure> | ||
| <schema_version>3.1</schema_version> | ||
| <name>reporting_measure_without_model_outputs</name> | ||
| <uid>a0876945-a15b-469d-bc22-90f133720e7c</uid> | ||
| <version_id>49740c2c-1804-4a4e-ace5-c30b6d350c5f</version_id> | ||
| <version_modified>2025-03-14T13:15:17Z</version_modified> | ||
| <xml_checksum>1DA817AF</xml_checksum> | ||
| <class_name>ReportingMeasureWithoutModelOutputs</class_name> | ||
| <display_name>ReportingMeasureWithoutModelOutputs</display_name> | ||
| <description>DESCRIPTION_TEXT</description> | ||
| <modeler_description>MODELER_DESCRIPTION_TEXT</modeler_description> | ||
| <arguments /> | ||
| <outputs /> | ||
| <provenances /> | ||
| <tags> | ||
| <tag>Reporting.QAQC</tag> | ||
| </tags> | ||
| <attributes> | ||
| <attribute> | ||
| <name>Measure Type</name> | ||
| <value>ReportingMeasure</value> | ||
| <datatype>string</datatype> | ||
| </attribute> | ||
| <attribute> | ||
| <name>Measure Language</name> | ||
| <value>Python</value> | ||
| <datatype>string</datatype> | ||
| </attribute> | ||
| </attributes> | ||
| <files> | ||
| <file> | ||
| <version> | ||
| <software_program>OpenStudio</software_program> | ||
| <identifier>3.9.0</identifier> | ||
| <min_compatible>3.9.0</min_compatible> | ||
| </version> | ||
| <filename>measure.py</filename> | ||
| <filetype>py</filetype> | ||
| <usage_type>script</usage_type> | ||
| <checksum>816BF07D</checksum> | ||
| </file> | ||
| </files> | ||
| </measure> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here the python hasMethod version