diff --git a/CHANGELOG.md b/CHANGELOG.md index ea94b831..f0da59df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,13 @@ # BuildingSync Gem -## Version 0.2.1 (Unreleased) +## Version 0.2.1 - Update copyright dates +- Update URL for BuildingSync selection tool +- Include buildingsync/generators when including gem by default +- BuildingSync to OpenStudio Translation for MLOD 200 +- Add action for building the documentation +- Fix purge measures method to only remove measures with SKIP argument set to True ## Version 0.2.0 diff --git a/README.md b/README.md index e9cc5e96..4ca3df3d 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ installed, then export the path of the folder that contains the openstudio.rb fi After installing OpenStudio and setting the environment variable, then add this line to your application's Gemfile: ```ruby -gem 'buildingsync', '0.2.0' +gem 'buildingsync', '0.2.1' ``` And then execute: diff --git a/lib/buildingsync/makers/workflow_maker.rb b/lib/buildingsync/makers/workflow_maker.rb index 72e61a77..9e3d9db4 100644 --- a/lib/buildingsync/makers/workflow_maker.rb +++ b/lib/buildingsync/makers/workflow_maker.rb @@ -518,15 +518,24 @@ def deep_copy_workflow # Removes unused measures from a workflow, where __SKIP__ == true # @param workflow [Hash] a hash of the openstudio workflow, typically after a deep # copy is made and the measures are configured for the specific scenario + # KAF: reworked to only delete measures with an explicit __SKIP__ == true + # (sometimes measure don't have a skip at all, assume we want to keep those) def purge_skipped_from_workflow(workflow) non_skipped = [] if !workflow.nil? && !workflow['steps'].nil? && workflow.key?('steps') workflow['steps'].each do |step| - if !step.nil? && step.key?('arguments') && !step['arguments'].nil? - if step['arguments'].key?('__SKIP__') && step['arguments']['__SKIP__'] == false + if !step.nil? && step.key?('arguments') + if step['arguments'].nil? + # no arguments, keep anyway + non_skipped << step + elsif step['arguments'].key?('__SKIP__') && step['arguments']['__SKIP__'] == false + # skip is set to false, keep + non_skipped << step + elsif !step['arguments'].key?('__SKIP__') + # no "SKIP" argument, keep anyway non_skipped << step end - end + end end workflow['steps'] = non_skipped end diff --git a/lib/buildingsync/translator.rb b/lib/buildingsync/translator.rb index 296b21ef..90eb80c8 100644 --- a/lib/buildingsync/translator.rb +++ b/lib/buildingsync/translator.rb @@ -93,8 +93,8 @@ def initialize(xml_file_path, output_dir, epw_file_path = nil, standard_to_be_us if validate_xml_file_against_schema validate_xml else - OpenStudio.logFree(OpenStudio::Info, 'BuildingSync.Translator.initialize', "File '#{xml_file_path}' was not validated against the BuildingSync schema") - puts "File '#{xml_file_path}' was not validated against the BuildingSync schema" + OpenStudio.logFree(OpenStudio::Info, 'BuildingSync.Translator.initialize', "File '#{xml_file_path}' was not validated against the BuildingSync schema version #{@schema_version}") + puts "File '#{xml_file_path}' was not validated against the BuildingSync schema version #{@schema_version}" end super(doc, ns) @@ -109,11 +109,12 @@ def validate_xml if !selection_tool.validate_schema raise "File '#{@xml_file_path}' does not valid against the BuildingSync schema" else - OpenStudio.logFree(OpenStudio::Info, 'BuildingSync.Translator.initialize', "File '#{@xml_file_path}' is valid against the BuildingSync schema") + OpenStudio.logFree(OpenStudio::Info, 'BuildingSync.Translator.initialize', "File '#{@xml_file_path}' is valid against the BuildingSync schema version #{@schema_version}") puts "File '#{@xml_file_path}' is valid against the BuildingSync schema" end - rescue StandardError - OpenStudio.logFree(OpenStudio::Error, 'BuildingSync.Translator.initialize', "File '#{@xml_file_path}' does not valid against the BuildingSync schema") + rescue StandardError => error + puts "ERROR: #{error}" + OpenStudio.logFree(OpenStudio::Error, 'BuildingSync.Translator.initialize', "File '#{@xml_file_path}' does not validate against the BuildingSync schema version #{@schema_version}") end # @see WorkflowMaker.setup_and_sizing_run diff --git a/lib/buildingsync/version.rb b/lib/buildingsync/version.rb index 4383cf20..9a15dd47 100644 --- a/lib/buildingsync/version.rb +++ b/lib/buildingsync/version.rb @@ -41,5 +41,5 @@ # provides features for reading BldgSync XML files, generating baseline models, creating scenario workflows, running simulations and adding simulation results to the BldgSync file module BuildingSync # version of the BuildingSync gem - VERSION = '0.2.0' + VERSION = '0.2.1' end