openstudio-analysis 1.0.0.rc9 → 1.0.0.rc10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0926ab12d7415a8a23c8c9b6c8345338e3f81dc8
4
- data.tar.gz: 37fc5579b3f27dc9ef8f12321ea2fdd2e94f503a
3
+ metadata.gz: 730a32510cb39282ef25487714f4b5e5c850ef61
4
+ data.tar.gz: b1b239cc0d42b7679e6587a12e0a645165f376cd
5
5
  SHA512:
6
- metadata.gz: 160ab740fecfcf67ad579edc96ba90e5d27a33bb731e2257ea1b0f6fe20d1afbbc8890e12e1ade07b034574713d7f18bd71d094a46272db0d7b427628d529492
7
- data.tar.gz: a09acd3014f457d158cd553333c12bc994f4fe50f70ea9b04bd5b0419716f4107dba5841f47fa306786a57e0070bfd1d5f4fc270af9b2b9e2c49124dde21ca5f
6
+ metadata.gz: bceff944862e1563f30f59cf098d8b0d5c4f31464774b094d9684e014e10cad4a62862be075410adf6e774aba0d7d9b3ceb0a9fe44ce9307b15f04329aa2bf2d
7
+ data.tar.gz: 4ee216a32f6a788ffb57f72f1c61e2b575b50fe1e52485745046ab76d6133eb00b38d4aa74feaf55a441eb348814196fda00d2c42075b399542daaa58b5e4091
data/.rubocop.yml CHANGED
@@ -17,63 +17,71 @@ Lint/ParenthesesAsGroupedExpression:
17
17
  Lint/RequireParentheses:
18
18
  Enabled: true
19
19
 
20
- # Offense count: 1
21
20
  Lint/UnreachableCode:
22
21
  Enabled: false
23
22
 
24
- # Offense count: 51
25
23
  Lint/UselessAssignment:
26
24
  Enabled: true
27
25
 
26
+ Lint/UnusedBlockArgument:
27
+ Description: 'Checks for unused block arguments.'
28
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
29
+ Enabled: false
30
+
31
+ Lint/UnusedMethodArgument:
32
+ Description: 'Checks for unused method arguments.'
33
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
34
+ Enabled: false
35
+
36
+ Lint/UselessAssignment:
37
+ Description: 'Checks for useless assignment to a local variable.'
38
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
39
+ Enabled: false
40
+
41
+ # ==================== Performance ========================
42
+
43
+ Performance/Casecmp:
44
+ Enabled: false
45
+
28
46
  # ==================== Styles / Metrics====================
29
- # Offense count: 4
47
+
30
48
  Metrics/BlockNesting:
31
49
  Max: 4
32
50
 
33
- # Offense count: 18
34
- # Configuration parameters: CountComments.
35
51
  Metrics/ClassLength:
36
52
  Max: 500
37
53
 
38
- # Offense count: 27
39
54
  Metrics/CyclomaticComplexity:
40
- Max: 48
55
+ Max: 50
41
56
 
42
- # Offense count: 974
43
57
  Metrics/LineLength:
44
- Max: 1200
58
+ Max: 120
45
59
 
46
- # Offense count: 87
47
- # Configuration parameters: CountComments.
48
60
  Metrics/MethodLength:
49
61
  Max: 350
50
62
 
51
- # Offense count: 1
52
- # Configuration parameters: CountKeywordArgs.
53
63
  Metrics/ParameterLists:
54
64
  Max: 8
55
65
 
56
66
  # ==================== Disabled on Purpose ====================
57
- # Offense count: 3
58
- Style/AccessorMethodName:
59
- Enabled: true
60
67
 
61
- # Need to allow indented case statements
62
- # Offense count: 9
68
+ # Allow indented case statements
63
69
  # Configuration parameters: IndentWhenRelativeTo, SupportedStyles, IndentOneStep.
64
70
  Style/CaseIndentation:
65
71
  Enabled: false
66
72
 
67
- # Offense count: 18
73
+ # Configuration parameters: EnforcedStyle, SupportedStyles, SingleLineConditionsOnly.
74
+ # SupportedStyles: assign_to_condition, assign_inside_condition
75
+ Style/ConditionalAssignment:
76
+ Enabled: false
77
+
68
78
  # Configuration parameters: EnforcedStyle, SupportedStyles.
69
79
  Style/ClassAndModuleChildren:
70
80
  Enabled: false
71
81
 
72
- # Offense count: 2
73
82
  Style/ClassVars:
74
83
  Enabled: false
75
84
 
76
- # Offense count: 42
77
85
  Style/Documentation:
78
86
  Enabled: false
79
87
 
@@ -81,31 +89,36 @@ Style/Documentation:
81
89
  Style/EachWithObject:
82
90
  Enabled: false
83
91
 
84
- # Offense count: 2
85
92
  # Configuration parameters: AllowedVariables.
86
93
  Style/GlobalVars:
87
94
  Enabled: false
88
95
 
89
- # Offense count: 7
90
96
  # Configuration parameters: MinBodyLength.
91
97
  Style/GuardClause:
92
98
  Enabled: true
93
99
 
94
- # Offense count: 17
95
100
  # Configuration parameters: MaxLineLength.
96
101
  Style/IfUnlessModifier:
97
102
  Enabled: false
98
103
 
99
- # Do NOT enable. For some reason this is catchy any next which I feel are okay.
100
- # Offense count: 18
104
+ # Configuration parameters: EnforcedStyle, SupportedStyles.
105
+ # SupportedStyles: symmetrical, new_line, same_line
106
+ Style/MultilineMethodCallBraceLayout:
107
+ Enabled: false
108
+
109
+ # Do NOT enable.
101
110
  # Configuration parameters: EnforcedStyle, SupportedStyles.
102
111
  Style/Next:
103
112
  Enabled: false
104
113
 
105
- # Do NOT enable this because it appears $? is different than $CHILD_STATUS.
106
- # Offense count: 7
107
- # Cop supports --auto-correct.
108
- Style/SpecialGlobalVars:
114
+ Style/NumericLiterals:
115
+ Description: 'Add underscores to large numeric literals to improve readability.'
116
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics'
117
+ Enabled: false
118
+
119
+ # Configuration parameters: AutoCorrect, EnforcedStyle, SupportedStyles.
120
+ # SupportedStyles: predicate, comparison
121
+ Style/NumericPredicate:
109
122
  Enabled: false
110
123
 
111
124
  # More Changes per DLM -- pulled from https://github.com/bbatsov/rubocop/blob/master/config/enabled.yml
@@ -114,22 +127,13 @@ Style/RedundantReturn:
114
127
  StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-explicit-return'
115
128
  Enabled: false
116
129
 
117
- Style/NumericLiterals:
118
- Description: 'Add underscores to large numeric literals to improve readability.'
119
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics'
130
+ Style/RedundantParentheses:
120
131
  Enabled: false
121
132
 
122
- Lint/UnusedBlockArgument:
123
- Description: 'Checks for unused block arguments.'
124
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
133
+ # Do NOT enable this because it appears $? is different than $CHILD_STATUS.
134
+ Style/SpecialGlobalVars:
125
135
  Enabled: false
126
136
 
127
- Lint/UnusedMethodArgument:
128
- Description: 'Checks for unused method arguments.'
129
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
137
+ Style/ZeroLengthPredicate:
130
138
  Enabled: false
131
139
 
132
- Lint/UselessAssignment:
133
- Description: 'Checks for useless assignment to a local variable.'
134
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
135
- Enabled: false
data/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  OpenStudio Analysis Gem Change Log
2
2
  ==================================
3
3
 
4
+ Version 1.0.0.rc10
5
+ ------------------
6
+ * Fix boolean data type in datapoints translator
7
+ * Allow __skip__ variable in datapoints translator
8
+
4
9
  Version 1.0.0.rc9
5
10
  -----------------
6
11
  * Fix bug in batch datapoints to look for outputs_json, not outputs when importing the definition of the outputs JSON file.
@@ -190,7 +190,7 @@ module OpenStudio
190
190
 
191
191
  h
192
192
  else
193
- fail "Version #{version} not defined for #{self.class} and #{__method__}"
193
+ raise "Version #{version} not defined for #{self.class} and #{__method__}"
194
194
  end
195
195
  end
196
196
 
@@ -218,7 +218,7 @@ module OpenStudio
218
218
  o.seed_model = h[:analysis][:seed][:path]
219
219
  end
220
220
  else
221
- fail "Version #{version} not defined for #{self.class} and #{__method__}"
221
+ raise "Version #{version} not defined for #{self.class} and #{__method__}"
222
222
  end
223
223
 
224
224
  o
@@ -293,7 +293,7 @@ module OpenStudio
293
293
  def save_analysis_zip(filename)
294
294
  def add_directory_to_zip(zipfile, local_directory, relative_zip_directory)
295
295
  # puts "Add Directory #{local_directory}"
296
- Dir[File.join("#{local_directory}", '**', '**')].each do |file|
296
+ Dir[File.join(local_directory.to_s, '**', '**')].each do |file|
297
297
  # puts "Adding File #{file}"
298
298
  zipfile.add(file.sub(local_directory, relative_zip_directory), file)
299
299
  end
@@ -331,7 +331,7 @@ module OpenStudio
331
331
 
332
332
  puts 'Adding Support Files: Libraries'
333
333
  @libraries.each do |lib|
334
- fail "Libraries must specify their 'library_name' as metadata which becomes the directory upon zip" unless lib[:metadata][:library_name]
334
+ raise "Libraries must specify their 'library_name' as metadata which becomes the directory upon zip" unless lib[:metadata][:library_name]
335
335
 
336
336
  if File.directory? lib[:file]
337
337
  Dir[File.join(lib[:file], '**', '**')].each do |file|
@@ -6,16 +6,16 @@ module OpenStudio
6
6
  attr_reader :hostname
7
7
 
8
8
  # Define set of anlaysis methods require batch_run to be queued after them
9
- BATCH_RUN_METHODS = %w(lhs preflight single_run repeat_run doe diag baseline_perturbation batch_datapoints)
9
+ BATCH_RUN_METHODS = %w(lhs preflight single_run repeat_run doe diag baseline_perturbation batch_datapoints).freeze
10
10
 
11
11
  def initialize(options = {})
12
- defaults = {hostname: 'http://localhost:8080'}
12
+ defaults = { hostname: 'http://localhost:8080' }
13
13
  options = defaults.merge(options)
14
14
  @logger = ::Logger.new('faraday.log')
15
15
 
16
16
  @hostname = options[:hostname]
17
17
 
18
- fail 'no host defined for server api class' if @hostname.nil?
18
+ raise 'no host defined for server api class' if @hostname.nil?
19
19
 
20
20
  # TODO: add support for the proxy
21
21
 
@@ -44,7 +44,7 @@ module OpenStudio
44
44
  if response.status == 200
45
45
  projects_json = JSON.parse(response.body, symbolize_names: true, max_nesting: false)
46
46
  else
47
- fail 'did not receive a 200 in get_projects'
47
+ raise 'did not receive a 200 in get_projects'
48
48
  end
49
49
 
50
50
  projects_json
@@ -82,12 +82,12 @@ module OpenStudio
82
82
  end
83
83
 
84
84
  def new_project(options = {})
85
- defaults = {project_name: "Project #{::Time.now.strftime('%Y-%m-%d %H:%M:%S')}"}
85
+ defaults = { project_name: "Project #{::Time.now.strftime('%Y-%m-%d %H:%M:%S')}" }
86
86
  options = defaults.merge(options)
87
87
  project_id = nil
88
88
 
89
89
  # TODO: make this a display name and a machine name
90
- project_hash = {project: {name: "#{options[:project_name]}"}}
90
+ project_hash = { project: { name: (options[:project_name]).to_s } }
91
91
 
92
92
  response = @conn.post do |req|
93
93
  req.url '/projects.json'
@@ -406,17 +406,17 @@ module OpenStudio
406
406
 
407
407
  def new_analysis(project_id, options)
408
408
  defaults = {
409
- analysis_name: nil,
410
- reset_uuids: false,
411
- push_to_dencity: false
409
+ analysis_name: nil,
410
+ reset_uuids: false,
411
+ push_to_dencity: false
412
412
  }
413
413
  options = defaults.merge(options)
414
414
 
415
- fail 'No project id passed' if project_id.nil?
415
+ raise 'No project id passed' if project_id.nil?
416
416
 
417
417
  formulation_json = nil
418
418
  if options[:formulation_file]
419
- fail "No formulation exists #{options[:formulation_file]}" unless File.exist?(options[:formulation_file])
419
+ raise "No formulation exists #{options[:formulation_file]}" unless File.exist?(options[:formulation_file])
420
420
  formulation_json = JSON.parse(File.read(options[:formulation_file]), symbolize_names: true)
421
421
  end
422
422
 
@@ -446,16 +446,16 @@ module OpenStudio
446
446
  end
447
447
 
448
448
  # set the analysis name
449
- formulation_json[:analysis][:name] = "#{options[:analysis_name]}" unless options[:analysis_name].nil?
449
+ formulation_json[:analysis][:name] = (options[:analysis_name]).to_s unless options[:analysis_name].nil?
450
450
  else
451
451
  formulation_json = {
452
- analysis: options
452
+ analysis: options
453
453
  }
454
454
  puts formulation_json
455
455
  analysis_id = SecureRandom.uuid
456
456
  formulation_json[:analysis][:uuid] = analysis_id
457
457
  end
458
- fail "No analysis id defined in analysis.json #{options[:formulation_file]}" if analysis_id.nil?
458
+ raise "No analysis id defined in analysis.json #{options[:formulation_file]}" if analysis_id.nil?
459
459
 
460
460
  # save out this file to compare
461
461
  # File.open('formulation_merge.json', 'w') { |f| f << JSON.pretty_generate(formulation_json) }
@@ -475,14 +475,14 @@ module OpenStudio
475
475
  upload_to_dencity(analysis_id, formulation_json) if options[:push_to_dencity]
476
476
  puts "new analysis created with ID: #{analysis_id}"
477
477
  else
478
- fail 'Could not create new analysis'
478
+ raise 'Could not create new analysis'
479
479
  end
480
480
 
481
481
  # check if we need to upload the analysis zip file
482
482
  if options[:upload_file]
483
- fail "upload file does not exist #{options[:upload_file]}" unless File.exist?(options[:upload_file])
483
+ raise "upload file does not exist #{options[:upload_file]}" unless File.exist?(options[:upload_file])
484
484
 
485
- payload = {file: Faraday::UploadIO.new(options[:upload_file], 'application/zip')}
485
+ payload = { file: Faraday::UploadIO.new(options[:upload_file], 'application/zip') }
486
486
  response = @conn_multipart.post "analyses/#{analysis_id}/upload.json", payload do |req|
487
487
  req.options[:timeout] = 1800 # seconds
488
488
  end
@@ -490,7 +490,7 @@ module OpenStudio
490
490
  if response.status == 201
491
491
  puts 'Successfully uploaded ZIP file'
492
492
  else
493
- fail response.inspect
493
+ raise response.inspect
494
494
  end
495
495
  end
496
496
 
@@ -501,13 +501,13 @@ module OpenStudio
501
501
  require 'dencity'
502
502
  puts "Attempting to connect to DEnCity server using settings at '~/.dencity/config.yml'"
503
503
  conn = Dencity.connect
504
- fail "Could not connect to DEnCity server at #{hostname}." unless conn.connected?
504
+ raise "Could not connect to DEnCity server at #{hostname}." unless conn.connected?
505
505
  begin
506
506
  r = conn.login
507
507
  rescue Faraday::ParsingError => user_id_failure
508
- fail "Error in user_id field: #{user_id_failure.message}"
508
+ raise "Error in user_id field: #{user_id_failure.message}"
509
509
  rescue MultiJson::ParseError => authentication_failure
510
- fail "Error in attempted authentication: #{authentication_failure.message}"
510
+ raise "Error in attempted authentication: #{authentication_failure.message}"
511
511
  end
512
512
  user_uuid = r.id
513
513
 
@@ -528,7 +528,7 @@ module OpenStudio
528
528
  break
529
529
  end
530
530
  end
531
- fail "Analysis with user_defined_id of #{analysis_uuid} found on DEnCity." if found_analysis_uuid
531
+ raise "Analysis with user_defined_id of #{analysis_uuid} found on DEnCity." if found_analysis_uuid
532
532
  dencity_hash = OpenStudio::Analysis.to_dencity_analysis(analysis, analysis_uuid)
533
533
 
534
534
  # Write the analysis DEnCity hash to dencity_analysis.json
@@ -544,14 +544,14 @@ module OpenStudio
544
544
  runner.registerError("Upload failure: #{e.message} in #{e.backtrace.join('/n')}")
545
545
  else
546
546
  if NoMethodError == upload_response.class
547
- fail "ERROR: Server responded with a NoMethodError: #{upload_response}"
547
+ raise "ERROR: Server responded with a NoMethodError: #{upload_response}"
548
548
  end
549
549
  if upload_response.status.to_s[0] == '2'
550
550
  puts 'Successfully uploaded processed analysis json file to the DEnCity server.'
551
551
  else
552
552
  puts 'ERROR: Server returned a non-20x status. Response below.'
553
553
  puts upload_response
554
- fail
554
+ raise
555
555
  end
556
556
  end
557
557
  end
@@ -562,12 +562,12 @@ module OpenStudio
562
562
  # @option options [String] :datapoint_file Path to datapoint JSON to upload
563
563
  # @option options [Boolean] :reset_uuids Flag on whether or not to reset the UUID in the datapoint JSON to a new random value.
564
564
  def upload_datapoint(analysis_id, options)
565
- defaults = {reset_uuids: false}
565
+ defaults = { reset_uuids: false }
566
566
  options = defaults.merge(options)
567
567
 
568
- fail 'No analysis id passed' if analysis_id.nil?
569
- fail 'No datapoints file passed to new_analysis' unless options[:datapoint_file]
570
- fail "No datapoints_file exists #{options[:datapoint_file]}" unless File.exist?(options[:datapoint_file])
568
+ raise 'No analysis id passed' if analysis_id.nil?
569
+ raise 'No datapoints file passed to new_analysis' unless options[:datapoint_file]
570
+ raise "No datapoints_file exists #{options[:datapoint_file]}" unless File.exist?(options[:datapoint_file])
571
571
 
572
572
  dp_hash = JSON.parse(File.open(options[:datapoint_file]).read, symbolize_names: true)
573
573
 
@@ -591,7 +591,7 @@ module OpenStudio
591
591
  puts "new datapoints created for analysis #{analysis_id}"
592
592
  return JSON.parse(response.body, symbolize_names: true)
593
593
  else
594
- fail "could not create new datapoints #{response.body}"
594
+ raise "could not create new datapoints #{response.body}"
595
595
  end
596
596
  end
597
597
 
@@ -601,9 +601,9 @@ module OpenStudio
601
601
  defaults = {}
602
602
  options = defaults.merge(options)
603
603
 
604
- fail 'No analysis id passed' if analysis_id.nil?
605
- fail 'No datapoints file passed to new_analysis' unless options[:datapoints_file]
606
- fail "No datapoints_file exists #{options[:datapoints_file]}" unless File.exist?(options[:datapoints_file])
604
+ raise 'No analysis id passed' if analysis_id.nil?
605
+ raise 'No datapoints file passed to new_analysis' unless options[:datapoints_file]
606
+ raise "No datapoints_file exists #{options[:datapoints_file]}" unless File.exist?(options[:datapoints_file])
607
607
 
608
608
  dp_hash = JSON.parse(File.open(options[:datapoints_file]).read, symbolize_names: true)
609
609
 
@@ -617,12 +617,12 @@ module OpenStudio
617
617
  if response.status == 201
618
618
  puts "new datapoints created for analysis #{analysis_id}"
619
619
  else
620
- fail "could not create new datapoints #{response.body}"
620
+ raise "could not create new datapoints #{response.body}"
621
621
  end
622
622
  end
623
623
 
624
624
  def start_analysis(analysis_id, options)
625
- defaults = {analysis_action: 'start', without_delay: false}
625
+ defaults = { analysis_action: 'start', without_delay: false }
626
626
  options = defaults.merge(options)
627
627
 
628
628
  puts "Run analysis is configured with #{options.to_json}"
@@ -636,14 +636,14 @@ module OpenStudio
636
636
  if response.status == 200
637
637
  puts "Received request to run analysis #{analysis_id}"
638
638
  else
639
- fail 'Could not start the analysis'
639
+ raise 'Could not start the analysis'
640
640
  end
641
641
  end
642
642
 
643
643
  # Kill the analysis
644
644
  # @param analysis [String] Analysis ID to stop
645
645
  def kill_analysis(analysis_id)
646
- analysis_action = {analysis_action: 'stop'}
646
+ analysis_action = { analysis_action: 'stop' }
647
647
 
648
648
  response = @conn.post do |req|
649
649
  req.url "analyses/#{analysis_id}/action.json"
@@ -750,9 +750,9 @@ module OpenStudio
750
750
  def run(formulation_filename, analysis_zip_filename, analysis_type,
751
751
  options = {})
752
752
  defaults = {
753
- run_data_point_filename: 'run_openstudio_workflow_monthly.rb',
754
- push_to_dencity: false,
755
- batch_run_method: 'batch_run'
753
+ run_data_point_filename: 'run_openstudio_workflow_monthly.rb',
754
+ push_to_dencity: false,
755
+ batch_run_method: 'batch_run'
756
756
  }
757
757
  options = defaults.merge(options)
758
758
 
@@ -760,20 +760,20 @@ module OpenStudio
760
760
  project_id = new_project(project_options)
761
761
 
762
762
  analysis_options = {
763
- formulation_file: formulation_filename,
764
- upload_file: analysis_zip_filename,
765
- reset_uuids: true,
766
- push_to_dencity: options[:push_to_dencity]
763
+ formulation_file: formulation_filename,
764
+ upload_file: analysis_zip_filename,
765
+ reset_uuids: true,
766
+ push_to_dencity: options[:push_to_dencity]
767
767
  }
768
768
 
769
769
  analysis_id = new_analysis(project_id, analysis_options)
770
770
 
771
771
  run_options = {
772
- analysis_action: 'start',
773
- without_delay: false,
774
- analysis_type: analysis_type,
775
- simulate_data_point_filename: 'simulate_data_point.rb', # TODO: remove these from server?
776
- run_data_point_filename: options[:run_data_point_filename]
772
+ analysis_action: 'start',
773
+ without_delay: false,
774
+ analysis_type: analysis_type,
775
+ simulate_data_point_filename: 'simulate_data_point.rb', # TODO: remove these from server?
776
+ run_data_point_filename: options[:run_data_point_filename]
777
777
  }
778
778
  start_analysis(analysis_id, run_options)
779
779
 
@@ -781,11 +781,11 @@ module OpenStudio
781
781
  # because there is no explicit way to tell the system to do it
782
782
  if BATCH_RUN_METHODS.include? analysis_type
783
783
  run_options = {
784
- analysis_action: 'start',
785
- without_delay: false,
786
- analysis_type: options[:batch_run_method],
787
- simulate_data_point_filename: 'simulate_data_point.rb',
788
- run_data_point_filename: options[:run_data_point_filename]
784
+ analysis_action: 'start',
785
+ without_delay: false,
786
+ analysis_type: options[:batch_run_method],
787
+ simulate_data_point_filename: 'simulate_data_point.rb',
788
+ run_data_point_filename: options[:run_data_point_filename]
789
789
  }
790
790
  start_analysis(analysis_id, run_options)
791
791
  end
@@ -799,18 +799,18 @@ module OpenStudio
799
799
  project_id = new_project(project_options)
800
800
 
801
801
  analysis_options = {
802
- formulation_file: formulation_filename,
803
- upload_file: analysis_zip_filename,
804
- reset_uuids: true
802
+ formulation_file: formulation_filename,
803
+ upload_file: analysis_zip_filename,
804
+ reset_uuids: true
805
805
  }
806
806
  analysis_id = new_analysis(project_id, analysis_options)
807
807
 
808
808
  run_options = {
809
- analysis_action: 'start',
810
- without_delay: false,
811
- analysis_type: analysis_type,
812
- simulate_data_point_filename: 'simulate_data_point.rb',
813
- run_data_point_filename: run_data_point_filename
809
+ analysis_action: 'start',
810
+ without_delay: false,
811
+ analysis_type: analysis_type,
812
+ simulate_data_point_filename: 'simulate_data_point.rb',
813
+ run_data_point_filename: run_data_point_filename
814
814
  }
815
815
  start_analysis(analysis_id, run_options)
816
816
 
@@ -822,18 +822,18 @@ module OpenStudio
822
822
  project_id = new_project(project_options)
823
823
 
824
824
  analysis_options = {
825
- formulation_file: nil,
826
- upload_file: nil,
827
- reset_uuids: true,
825
+ formulation_file: nil,
826
+ upload_file: nil,
827
+ reset_uuids: true
828
828
  }
829
829
  analysis_id = new_analysis(project_id, analysis_options)
830
830
 
831
831
  run_options = {
832
- analysis_action: 'start',
833
- without_delay: false,
834
- analysis_type: 'batch_run_analyses',
835
- simulate_data_point_filename: 'simulate_data_point.rb',
836
- run_data_point_filename: 'run_openstudio_workflow_monthly.rb'
832
+ analysis_action: 'start',
833
+ without_delay: false,
834
+ analysis_type: 'batch_run_analyses',
835
+ simulate_data_point_filename: 'simulate_data_point.rb',
836
+ run_data_point_filename: 'run_openstudio_workflow_monthly.rb'
837
837
  }
838
838
  start_analysis(analysis_id, run_options)
839
839
 
@@ -18,7 +18,7 @@ module OpenStudio
18
18
  # @return [Boolean] Returns false if the file does not exist
19
19
  def add(path_or_filename, metadata = {})
20
20
  if !File.exist?(path_or_filename) && !Dir.exist?(path_or_filename)
21
- fail "Path or file does not exist and cannot be added: #{path_or_filename}"
21
+ raise "Path or file does not exist and cannot be added: #{path_or_filename}"
22
22
  end
23
23
 
24
24
  # only add if it isn't allready in the list