Skip to content

Commit

Permalink
Brings the skip_simulation arg back; forgot that BEopt uses it.
Browse files Browse the repository at this point in the history
  • Loading branch information
shorowit committed Oct 11, 2024
1 parent 73460f9 commit 5b28c43
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
6 changes: 3 additions & 3 deletions HPXMLtoOpenStudio/measure.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<schema_version>3.1</schema_version>
<name>hpxm_lto_openstudio</name>
<uid>b1543b30-9465-45ff-ba04-1d1f85e763bc</uid>
<version_id>16835647-9a13-44b7-b907-a57abf30a8d4</version_id>
<version_modified>2024-10-11T14:51:15Z</version_modified>
<version_id>c80e402f-4c82-4eae-9336-698bde0e09c3</version_id>
<version_modified>2024-10-11T18:59:49Z</version_modified>
<xml_checksum>D8922A73</xml_checksum>
<class_name>HPXMLtoOpenStudio</class_name>
<display_name>HPXML to OpenStudio Translator</display_name>
Expand Down Expand Up @@ -429,7 +429,7 @@
<filename>meta_measure.rb</filename>
<filetype>rb</filetype>
<usage_type>resource</usage_type>
<checksum>979E2224</checksum>
<checksum>F335EDC8</checksum>
</file>
<file>
<filename>minitest_helper.rb</filename>
Expand Down
13 changes: 9 additions & 4 deletions HPXMLtoOpenStudio/resources/meta_measure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Initialize OpenStudio objects (log, model, runner, etc.).
# Call run methods of OpenStudio Model measures.
# Report infos/warnings/errors to run.log file.
# Forward translate the model and call energyPlusOutputRequests methods.
# Forward translate the model, write IDF, and call energyPlusOutputRequests methods.
# Again, report any log messages to file.
# Simulate the IDF using the EnergyPlus CLI.
# Call run methods of OpenStudio ReportingMeasures.
Expand All @@ -15,12 +15,13 @@
# @param measures [Hash] Map of OpenStudio-HPXML measure directory name => List of measure argument hashes
# @param measures_dir [String] Parent directory path of all OpenStudio-HPXML measures
# @param debug [Boolean] If true, reports info statements from the runner results
# @param run_measures_only [Boolean] True applies only OpenStudio Model measures, skipping forward translation and the simulation
# @param run_measures_only [Boolean] True applies only OpenStudio Model measures, skipping IDF generation and the simulation
# @param skip_simulation [Boolean] True applies the OpenStudio Model measures and generates the IDF, but skips the simulation
# @param ep_input_format [String] EnergyPlus input file format (idf, epjson)
# @param suppress_print [Boolean] True reduces printed workflow output
# @return [Hash] Map of 'success' and 'runner' results
def run_hpxml_workflow(rundir, measures, measures_dir, debug: false,
run_measures_only: false, ep_input_format: 'idf', suppress_print: false)
def run_hpxml_workflow(rundir, measures, measures_dir, debug: false, run_measures_only: false,
skip_simulation: false, ep_input_format: 'idf', suppress_print: false)
rm_path(rundir)
FileUtils.mkdir_p(rundir)

Expand Down Expand Up @@ -99,6 +100,10 @@ def run_hpxml_workflow(rundir, measures, measures_dir, debug: false,
fail "Unexpected ep_input_format: #{ep_input_format}."
end

if skip_simulation
return { success: success, runner: runner }
end

if not model.getWeatherFile.path.is_initialized
print "Creating input unsuccessful.\n"
print "See #{File.join(rundir, 'run.log')} for details.\n"
Expand Down

0 comments on commit 5b28c43

Please sign in to comment.