MCPcopy Create free account
hub / github.com/NatLabRockies/OpenStudio / execute

Method execute

ruby/engine/openstudio_cli.rb:894–1186  ·  view source on GitHub ↗

Executes the standard, or one of two custom, workflows using the workflow-gem @param [Array] sub_argv Options passed to the run command from the user input @return [Fixnum] Return status

(sub_argv)

Source from the content-addressed store, hash-verified

892 # @return [Fixnum] Return status
893 #
894 def execute(sub_argv)
895
896 $logger.info "Run, sub_argv = #{sub_argv}"
897
898 # options are local to this method, run_methods are what get passed to workflow gem
899 run_options = {}
900
901 # Hidden option shhhhh
902 run_options[:fast] = false
903 if sub_argv.delete '--fast'
904 run_options[:fast] = true
905 end
906
907 options = {}
908 options[:debug] = false
909 options[:no_simulation] = false
910 options[:osw_path] = './workflow.osw'
911 options[:post_process] = false
912 options[:ep_json] = false
913 options[:ft_options] = {}
914 options[:show_stdout] = false
915 options[:add_timings] = false
916 options[:style_stdout] = false
917 # TODO: I don't know if there's any value harcoding a default here really
918 # options[:ft_options] = {
919 # :runcontrolspecialdays => true,
920 # :ip_tabular_output => false,
921 # :no_lifecyclecosts => false,
922 # :no_sqlite_output => false,
923 # :no_html_output => false,
924 # :no_variable_dictionary => false,
925 # :no_space_translation => false,
926 # }
927
928 opts = OptionParser.new do |o|
929 o.banner = 'Usage: openstudio run [options]'
930 o.separator ''
931 o.separator 'Options:'
932 o.separator ''
933
934 o.on('-w', '--workflow [FILE]', 'Specify the FILE path to the workflow to run') do |osw_path|
935 options[:osw_path] = osw_path
936 end
937 o.on('-m', '--measures_only', 'Only run the OpenStudio and EnergyPlus measures') do
938 options[:no_simulation] = true
939 end
940 o.on('-p', '--postprocess_only', 'Only run the reporting measures') do
941 options[:post_process] = true
942 end
943 o.on('--export-epJSON', 'export epJSON file format. The default is IDF') do
944 options[:ep_json] = true
945 end
946 o.on('-s', '--socket PORT', 'Pipe status messages to a socket on localhost PORT') do |port|
947 options[:socket] = port
948 end
949 o.on('--show-stdout', 'Prints the output of the workflow run in real time to the console, including E+ output') do
950 options[:show_stdout] = true
951 end

Callers

nothing calls this directly

Calls 10

parse_optionsFunction · 0.85
infoMethod · 0.80
debugMethod · 0.80
absolute_pathMethod · 0.80
acceptMethod · 0.80
nowMethod · 0.80
errorMethod · 0.45
run_dirMethod · 0.45
openMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected