openstudio-analysis 1.3.5 → 1.3.7

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
  SHA256:
3
- metadata.gz: b2b3fab59aeec813435361079d2ce2453b30c3a21d4c3d13addfede64fc944bb
4
- data.tar.gz: 20c2f50da2c0f0e34076ad11680e584fd35f79bb688d5224b4fa5783173df77e
3
+ metadata.gz: 8e02ddfed034d22644f57f829611644aa06fb15122511288f2fa5657912c74b7
4
+ data.tar.gz: dd20b2f87b2c3e09dbc02691958456b953f6a9076ac273ba392c5b7e4f6ef2ad
5
5
  SHA512:
6
- metadata.gz: 3d34d8ea49de5a7f248643209d6c8d1942996dfedc91a57801faf2f664d0a04b06930d58f2bfbc3d2034a22f5bb637f06a759e0dd67524dd060c7c8d95fb93ba
7
- data.tar.gz: 9a334296581594e233cca22f651da024be123696dab49d592d2a38bc29857585bed08ce1f8afa8c3bfc5f517632d5918bb0b9c5f02e70970473c5f525748bb5f
6
+ metadata.gz: 4db14ed5e381e1c4a0b3f22b8f866e219d263c0a3d7bde13a2eb8a080807baae23eb06383509fb8721fabbb1bb598a112f614ccd43465610684527b696024d50
7
+ data.tar.gz: 6f72189583fa3b4c2057c383011e702273de5711df310fef3f7068952037f23bd4f092e049470899f90f35eef2af224aab034c7e824775b802fea542ab55c111
@@ -8,7 +8,7 @@ jobs:
8
8
  runs-on: ubuntu-18.04
9
9
  steps:
10
10
  - name: Check out repository
11
- uses: actions/checkout@v2
11
+ uses: actions/checkout@v4
12
12
  - name: ruby-install
13
13
  shell: bash
14
14
  run: "sudo apt install -y ruby && ruby -v" # ruby anye tests here when ready
@@ -18,7 +18,7 @@ jobs:
18
18
  steps:
19
19
  -
20
20
  name: Check out repository
21
- uses: actions/checkout@v2
21
+ uses: actions/checkout@v4
22
22
  -
23
23
  name: Display system info
24
24
  run: |
@@ -36,5 +36,5 @@ jobs:
36
36
  run: |
37
37
  docker run -e COVERALLS_REPO_TOKEN=${COVERALLS_REPO_TOKEN} \
38
38
  -v $(pwd):/var/simdata/openstudio \
39
- nrel/openstudio:develop \
39
+ nrel/openstudio:3.7.0 \
40
40
  /bin/bash -c "bundle install && bundle exec rake"
data/CHANGELOG.md CHANGED
@@ -1,6 +1,15 @@
1
1
  OpenStudio(R) Analysis Gem Change Log
2
2
  ==================================
3
3
 
4
+ Version 1.3.7
5
+ -------------
6
+ * Add move_measure_after()
7
+ * Add custom Gemfile to zip: osa.gem_files.add('spec/files/gem_files/Gemfile')
8
+
9
+ Version 1.3.6
10
+ -------------
11
+ * Bump BCL and Rubocop
12
+
4
13
  Version 1.3.5
5
14
  -------------
6
15
  * Increase Timeouts and write_timeouts to deal with latencies for network related issues
@@ -38,6 +38,7 @@ module OpenStudio
38
38
  attr_accessor :initialize_worker_timeout
39
39
  attr_accessor :run_workflow_timeout
40
40
  attr_accessor :upload_results_timeout
41
+
41
42
 
42
43
  # the attributes below are used for packaging data into the analysis zip file
43
44
  attr_reader :weather_files
@@ -46,6 +47,7 @@ module OpenStudio
46
47
  attr_reader :worker_finalizes
47
48
  attr_reader :libraries
48
49
  attr_reader :server_scripts
50
+ attr_reader :gem_files
49
51
 
50
52
  # Create an instance of the OpenStudio::Analysis::Formulation
51
53
  #
@@ -72,6 +74,7 @@ module OpenStudio
72
74
 
73
75
  # Analysis Zip attributes
74
76
  @weather_files = SupportFiles.new
77
+ @gem_files = SupportFiles.new
75
78
  @seed_models = SupportFiles.new
76
79
  @worker_inits = SupportFiles.new
77
80
  @worker_finalizes = SupportFiles.new
@@ -321,11 +324,18 @@ module OpenStudio
321
324
  h[:analysis][:download_reports] = @download_reports
322
325
  h[:analysis][:download_osw] = @download_osw
323
326
  h[:analysis][:download_osm] = @download_osm
324
-
327
+
328
+ # If there are Gemfiles, then set the hash to use the :gemfile. The zip file method will
329
+ # add them to the root of the zip file.
330
+ if @gem_files.size.positive?
331
+ h[:analysis][:gemfile] = true
332
+ else
333
+ h[:analysis][:gemfile] = false
334
+ end
335
+
325
336
  #-BLB I dont think this does anything. server_scripts are run if they are in
326
337
  #the /scripts/analysis or /scripts/data_point directories
327
338
  #but nothing is ever checked in the OSA.
328
- #
329
339
  h[:analysis][:server_scripts] = {}
330
340
 
331
341
  # This is a hack right now, but after the initial hash is created go back and add in the objective functions
@@ -335,6 +345,8 @@ module OpenStudio
335
345
  h[:analysis][:problem][:algorithm][:objective_functions] = ofs
336
346
  end
337
347
 
348
+
349
+
338
350
  h
339
351
  else
340
352
  raise "Version #{version} not defined for #{self.class} and #{__method__}"
@@ -710,6 +722,12 @@ module OpenStudio
710
722
  end
711
723
  end
712
724
 
725
+ puts 'Adding Gemfiles'
726
+ @gem_files.each do |f|
727
+ puts " Adding #{f[:file]}"
728
+ zf.add(File.basename(f[:file]), f[:file])
729
+ end
730
+
713
731
  ## Measures
714
732
  puts 'Adding Measures'
715
733
  added_measures = []
@@ -826,6 +844,12 @@ module OpenStudio
826
844
  file.close
827
845
  end
828
846
  end
847
+
848
+ puts 'Adding Gemfiles'
849
+ @gem_files.each do |f|
850
+ puts " Adding #{f}"
851
+ zf.add(File.basename(f), f)
852
+ end
829
853
 
830
854
  ## Measures
831
855
  puts 'Adding Measures'
@@ -7,6 +7,6 @@ module OpenStudio
7
7
  module Analysis
8
8
  # format should be ^.*\-{1}[a-z]+[0-9]+
9
9
  # for example: -rc1, -beta6, -customusecase0
10
- VERSION = '1.3.5'.freeze
10
+ VERSION = '1.3.7'.freeze
11
11
  end
12
12
  end
@@ -184,6 +184,29 @@ module OpenStudio
184
184
  end
185
185
  alias find_workflow_step find_measure
186
186
 
187
+ # Move a measure by its name to after another measure by its name,
188
+ # error if there is no measure with the name. If no after measure
189
+ # name is passed, then it will be at the beginning
190
+ #
191
+ # @params measure_name [String] instance name of the measure
192
+ # @params after_measure_name [String] instance name of the measure to move after
193
+ def move_measure_after(measure_name, after_measure_name=nil)
194
+ measure = self.find_measure(measure_name)
195
+ raise "Could not find measure with name #{measure_name}" unless measure
196
+
197
+ if after_measure_name.nil?
198
+ # put the measure at the beginning
199
+ @items.insert(0, @items.delete(measure))
200
+ else
201
+ after_measure = self.find_measure(after_measure_name)
202
+ raise "Could not find measure with name #{after_measure_name}" unless after_measure
203
+
204
+ # the index will be the index of the after measure plus 1 or the len of the list
205
+ idx = [@items.index(after_measure)+1, @items.length-1].min
206
+ @items.insert(idx, @items.delete(measure))
207
+ end
208
+ end
209
+
187
210
  # Return all the variables in the analysis as an array. The list that is returned is read only.
188
211
  #
189
212
  # @return [Array] All variables in the workflow
@@ -23,7 +23,7 @@ Gem::Specification.new do |s|
23
23
 
24
24
  s.required_ruby_version = '~> 2.7.0'
25
25
 
26
- s.add_dependency 'bcl', '~> 0.7.0'
26
+ s.add_dependency 'bcl', '~> 0.7.1'
27
27
  s.add_dependency 'dencity', '~> 0.1.0'
28
28
  s.add_dependency 'faraday', '~> 1.0.1'
29
29
  s.add_dependency 'roo', '~> 2.8.3'
@@ -33,6 +33,6 @@ Gem::Specification.new do |s|
33
33
  s.add_development_dependency 'json-schema', '~> 2.8.0'
34
34
  s.add_development_dependency 'rake', '~> 13.0'
35
35
  s.add_development_dependency 'rspec', '~> 3.9'
36
- s.add_development_dependency 'rubocop', '~> 0.54.0'
36
+ s.add_development_dependency 'rubocop', '~> 1.15.0'
37
37
  s.add_development_dependency 'rubocop-checkstyle_formatter', '~> 0.4.0'
38
38
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openstudio-analysis
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.5
4
+ version: 1.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicholas Long
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-09-29 00:00:00.000000000 Z
11
+ date: 2024-05-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bcl
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.7.0
19
+ version: 0.7.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.7.0
26
+ version: 0.7.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: dencity
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -142,14 +142,14 @@ dependencies:
142
142
  requirements:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: 0.54.0
145
+ version: 1.15.0
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: 0.54.0
152
+ version: 1.15.0
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: rubocop-checkstyle_formatter
155
155
  requirement: !ruby/object:Gem::Requirement
@@ -202,7 +202,7 @@ homepage: http://openstudio.nrel.gov
202
202
  licenses:
203
203
  - BSD
204
204
  metadata: {}
205
- post_install_message:
205
+ post_install_message:
206
206
  rdoc_options: []
207
207
  require_paths:
208
208
  - lib
@@ -218,7 +218,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
218
218
  version: '0'
219
219
  requirements: []
220
220
  rubygems_version: 3.1.4
221
- signing_key:
221
+ signing_key:
222
222
  specification_version: 4
223
223
  summary: Create JSON, ZIP to communicate with OpenStudio Distributed Analysis in the
224
224
  Cloud