Skip to content

Commit

Permalink
Merge pull request #142 from NREL/develop
Browse files Browse the repository at this point in the history
Prep Release 2.3.1
  • Loading branch information
nllong committed Nov 3, 2021
2 parents 19610d1 + af55515 commit 67a66cf
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 16 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,6 +1,10 @@
OpenStudio::Workflow Change Log
==================================

Version 2.3.1
-------------
* Forward tranlsation when !@run_options.get.forwardTranslateOptions().empty?

Version 2.3.0
-------------
* Feature [#135](https://github.com/NREL/OpenStudio-workflow-gem/issues/135) Add option to export/run epJSON
Expand Down
2 changes: 1 addition & 1 deletion lib/openstudio/workflow/adapters/input/local.rb
Expand Up @@ -363,7 +363,7 @@ def ft_options(user_options, default, logger)

# try to read from OSW

if @run_options.is_initialized && @run_options.get.respond_to?(:forwardTranslateOptions)
if @run_options.is_initialized && @run_options.get.respond_to?(:forwardTranslateOptions) && !@run_options.get.forwardTranslateOptions().empty?
ft_opts = {}
JSON.parse(@run_options.get.forwardTranslateOptions, symbolize_names: true).each do |opt_flag_name, opt_flag|
unless known_ft_opts.key?(opt_flag_name)
Expand Down
2 changes: 1 addition & 1 deletion lib/openstudio/workflow/version.rb
Expand Up @@ -37,6 +37,6 @@

module OpenStudio
module Workflow
VERSION = '2.3.0' # Suffixes must have periods (not dashes)
VERSION = '2.3.1' # Suffixes must have periods (not dashes)
end
end
32 changes: 18 additions & 14 deletions spec/openstudio/workflow/workflow_analysis_ft_options_spec.rb
Expand Up @@ -50,25 +50,29 @@
expect(k.run).to eq :finished
end

it 'should run compact OSW file with translator options 1' do
it 'should run compact OSW file with translator option space_translation' do
osw_path = File.expand_path('../../files/compact_osw/compact.osw', __dir__)
osw_out_path = osw_path.gsub(File.basename(osw_path), 'out.osw')

FileUtils.rm_rf(osw_out_path) if File.exist?(osw_out_path)
expect(File.exist?(osw_out_path)).to eq false

run_options = {
debug: true,
ft_options: {
runcontrolspecialdays: true,
ip_tabular_output: true,
no_lifecyclecosts: true,
no_sqlite_output: true,
no_html_output: true,
no_variable_dictionary: true,
no_space_translation: true
}
}

debug: true,
ft_options: {
runcontrolspecialdays: false,
ip_tabular_output: false,
no_lifecyclecosts: false,
no_sqlite_output: false,
no_html_output: false,
no_variable_dictionary: false,
no_space_translation: false
}

}


k = OpenStudio::Workflow::Run.new osw_path, run_options
expect(k).to be_instance_of OpenStudio::Workflow::Run
expect(k.run).to eq :finished
Expand All @@ -89,7 +93,7 @@
end
end

it 'should run compact OSW file with translator options 2' do
it 'should run compact OSW file with translator options no space translation' do
osw_path = File.expand_path('../../files/compact_osw/compact.osw', __dir__)
osw_out_path = osw_path.gsub(File.basename(osw_path), 'out.osw')

Expand All @@ -106,7 +110,7 @@
no_sqlite_output: false,
no_html_output: false,
no_variable_dictionary: false,
no_space_translation: false
no_space_translation: true
}

}
Expand Down

0 comments on commit 67a66cf

Please sign in to comment.