openstudio-extension 0.1.6 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -810,7 +810,6 @@ module OsLib_Reporting
810
810
  summary_types << ['Heating Capacity', 'maxHeatingCapacity', 'W', 1, 'Btu/hr', 1]
811
811
  summary_types << ['Cooling Capacity', 'maxCoolingCapacity', 'W', 1, 'ton', 1]
812
812
  summary_types << ['Water Flow Rate', 'maxWaterFlowRate', 'm^3/s', 4, 'gal/min', 2]
813
- summary_types << ['Rated Power', 'ratedPower', 'W', 1, 'W', 1]
814
813
  summary_types.each do |s|
815
814
  val_name = s[0]
816
815
  val_method = s[1]
@@ -1213,34 +1212,37 @@ module OsLib_Reporting
1213
1212
  thermal_zones.each do |zone|
1214
1213
  total_loop_floor_area += zone.floorArea
1215
1214
  end
1216
-
1215
+ #julien
1217
1216
  source_units = 'm^2'
1218
1217
  if is_ip_units
1219
1218
  target_units = 'ft^2'
1220
1219
  else
1221
1220
  target_units = source_units
1222
1221
  end
1223
- total_loop_floor_area = OpenStudio.convert(total_loop_floor_area, source_units, target_units).get
1224
- total_loop_floor_area_neat = OpenStudio.toNeatString(total_loop_floor_area, 0, true)
1222
+ total_loop_floor_area_ip = OpenStudio.convert(total_loop_floor_area, source_units, target_units).get
1223
+ total_loop_floor_area_ip_neat = OpenStudio.toNeatString(total_loop_floor_area_ip, 0, true)
1225
1224
 
1226
1225
  # output zone and terminal data
1226
+ #julien
1227
1227
  if is_ip_units
1228
- output_data_air_loops[:data] << ['Thermal Zones', 'Total Floor Area', "#{total_loop_floor_area_neat} ft^2", '', thermal_zones.size]
1228
+ output_data_air_loops[:data] << ['Thermal Zones', 'Total Floor Area', "#{total_loop_floor_area_ip_neat} ft^2", '', thermal_zones.size]
1229
1229
  else
1230
- output_data_air_loops[:data] << ['Thermal Zones', 'Total Floor Area', "#{total_loop_floor_area_neat} m^2", '', thermal_zones.size]
1231
- end
1232
-
1233
- # heating and cooling temperature range data
1234
- source_units = 'C'
1235
- if is_ip_units
1236
- target_units = 'F'
1237
- target_units_display = 'F'
1238
- else
1239
- target_units = source_units
1240
- target_units_display = 'C'
1230
+ output_data_air_loops[:data] << ['Thermal Zones', 'Total Floor Area', "#{total_loop_floor_area_ip_neat} m^2", '', thermal_zones.size]
1241
1231
  end
1242
1232
  if cooling_temp_ranges.empty?
1243
1233
  cooling_temp_ranges_pretty = "can't inspect schedules"
1234
+
1235
+ #julien
1236
+ source_units = 'C'
1237
+ if is_ip_units
1238
+ target_units = 'F'
1239
+ target_units_display = "F"
1240
+ else
1241
+ target_units = source_units
1242
+ target_units_display = "C"
1243
+ end
1244
+
1245
+
1244
1246
  else
1245
1247
  cooling_temp_ranges_pretty = "#{OpenStudio.convert(cooling_temp_ranges.min, source_units, target_units).get.round(1)} to #{OpenStudio.convert(cooling_temp_ranges.max, source_units, target_units).get.round(1)}"
1246
1248
  end
@@ -1249,6 +1251,17 @@ module OsLib_Reporting
1249
1251
  else
1250
1252
  heating_temps_ranges_pretty = "#{OpenStudio.convert(heating_temps_ranges.min, source_units, target_units).get.round(1)} to #{OpenStudio.convert(heating_temps_ranges.max, source_units, target_units).get.round(1)}"
1251
1253
  end
1254
+
1255
+ #julien
1256
+ source_units = 'C'
1257
+ if is_ip_units
1258
+ target_units = 'F'
1259
+ target_units_display = "F"
1260
+ else
1261
+ target_units = source_units
1262
+ target_units_display = "C"
1263
+ end
1264
+ #julien => ok? Tjs dans la boucle?
1252
1265
  output_data_air_loops[:data] << ['Thermal Zones', 'Cooling Setpoint Range', "#{cooling_temp_ranges_pretty} #{target_units_display}", '', '']
1253
1266
  output_data_air_loops[:data] << ['Thermal Zones', 'Heating Setpoint Range', "#{heating_temps_ranges_pretty} #{target_units_display}", '', '']
1254
1267
  output_data_air_loops[:data] << ['Terminal Types Used', terminals.uniq.sort.join(', '), '', '', terminals.size]
@@ -3011,13 +3024,6 @@ module OsLib_Reporting
3011
3024
  ann_env_pd = OsLib_Reporting.ann_env_pd(sqlFile)
3012
3025
  if ann_env_pd
3013
3026
 
3014
- # store values about humidity fir reguster values
3015
- zone_max_hours_over_70_rh = 0
3016
- zone_max_hours_over_55_rh = 0
3017
- rh_hours_threshold = 10 #hr
3018
- num_zones_x_hours_over_70 = 0
3019
- num_zones_x_hours_over_55 = 0
3020
-
3021
3027
  # get keys
3022
3028
  keys = sqlFile.availableKeyValues(ann_env_pd, 'Hourly', 'Zone Air Relative Humidity')
3023
3029
  keys.each do |key|
@@ -3026,10 +3032,6 @@ module OsLib_Reporting
3026
3032
  humidity_bins[k] = 0
3027
3033
  end
3028
3034
 
3029
- # reset humidity zone flag
3030
- zone_rh_count_hr_55 = 0.0
3031
- zone_rh_count_hr_70 = 0.0
3032
-
3033
3035
  # get desired variable
3034
3036
  output_timeseries = sqlFile.timeSeries(ann_env_pd, 'Hourly', 'Zone Air Relative Humidity', key)
3035
3037
  # loop through timeseries and move the data from an OpenStudio timeseries to a normal Ruby array (vector)
@@ -3077,34 +3079,11 @@ module OsLib_Reporting
3077
3079
  else
3078
3080
  row_color << ''
3079
3081
  end
3080
-
3081
- # populate rh data for register_values
3082
- # catch greater than 70 and 80 for runner.registerValue
3083
- if ['55-60','60-65','65-70','70-75','75-80','>= 80'].include?(k)
3084
- zone_rh_count_hr_55 += v
3085
- end
3086
- if ['70-75','75-80','>= 80'].include?(k)
3087
- zone_rh_count_hr_70 += v
3088
- end
3089
-
3090
3082
  end
3091
3083
  row_data += ["#{mean.round(1)} (%)"]
3092
3084
  row_color += ['']
3093
3085
  humidity_table[:data] << row_data
3094
3086
  humidity_table[:data_color] << row_color
3095
-
3096
- # apply rh zones and max hours
3097
- if zone_rh_count_hr_55 >= rh_hours_threshold then num_zones_x_hours_over_55 += 1 end
3098
- if zone_rh_count_hr_70 >= rh_hours_threshold then num_zones_x_hours_over_70 += 1 end
3099
- if zone_max_hours_over_55_rh < zone_rh_count_hr_55 then zone_max_hours_over_55_rh = zone_rh_count_hr_55 end
3100
- if zone_max_hours_over_70_rh < zone_rh_count_hr_70 then zone_max_hours_over_70_rh = zone_rh_count_hr_70 end
3101
-
3102
- # add rh runner.registerValues to be used as output in analyses
3103
- runner.registerValue("zone_max_hours_over_70_rh",zone_max_hours_over_70_rh,"hr")
3104
- runner.registerValue("zone_max_hours_over_55_rh",zone_max_hours_over_55_rh,"hr")
3105
- runner.registerValue("num_zones_x_hours_over_70",num_zones_x_hours_over_70,"zones")
3106
- runner.registerValue("num_zones_x_hours_over_55",num_zones_x_hours_over_55,"zones")
3107
-
3108
3087
  end
3109
3088
  else
3110
3089
  runner.registerWarning('An annual simulation was not run. Cannot get annual timeseries data')
@@ -4670,86 +4649,4 @@ module OsLib_Reporting
4670
4649
 
4671
4650
  return @schedules_overview_section
4672
4651
  end
4673
-
4674
- # create measure_warning_section (creates tables and runner.registerValues)
4675
- def self.measure_warning_section(model, sqlFile, runner, name_only = false, is_ip_units = true)
4676
- # array to hold tables
4677
- measure_tables = []
4678
-
4679
- # gather data for section
4680
- @measure_warnings_section = {}
4681
- @measure_warnings_section[:title] = 'Measure Warnings'
4682
- @measure_warnings_section[:tables] = measure_tables
4683
-
4684
- # stop here if only name is requested this is used to populate display name for arguments
4685
- if name_only == true
4686
- return @measure_warnings_section
4687
- end
4688
-
4689
- # will be used for registerValues
4690
- num_measures_with_warnings = 0
4691
- num_warnings = 0
4692
- num_measures = 0
4693
-
4694
- # loop through workflow steps
4695
- runner.workflow.workflowSteps.each do |step|
4696
- if step.to_MeasureStep.is_initialized
4697
- measure_step = step.to_MeasureStep.get
4698
- measure_name = measure_step.measureDirName
4699
- num_measures += 1
4700
- if measure_step.name.is_initialized
4701
- measure_name = measure_step.name.get # this is instance name in PAT
4702
- end
4703
- if measure_step.result.is_initialized
4704
- result = measure_step.result.get
4705
- # create and populate table if warnings exist
4706
- if result.warnings.size > 0
4707
- measure_table_01 = {}
4708
- measure_table_01[:title] = measure_name
4709
- measure_table_01[:header] = ['Warning']
4710
- measure_table_01[:data] = []
4711
- num_measures_with_warnings += 1
4712
-
4713
- # step through warnings
4714
- start_counter = num_warnings
4715
- result.warnings.each do |step|
4716
- # add rows to table and register value
4717
- num_warnings += 1
4718
- if num_warnings < start_counter + 25
4719
- measure_table_01[:data] << [step.logMessage]
4720
- else
4721
- measure_table_01[:data] << ["* See OSW file for full list of warnings. This measure has #{result.warnings.size} warnings."]
4722
- end
4723
- end
4724
- # add table to section
4725
- measure_tables << measure_table_01
4726
- end
4727
- else
4728
- # puts "No result for #{measure_name}"
4729
- end
4730
- else
4731
- # puts "This step is not a measure"
4732
- end
4733
- end
4734
-
4735
- # add summary table (even when there are no warnings)
4736
- measure_table_summary = {}
4737
- measure_table_summary[:title] = "Measure Warning Summary"
4738
- measure_table_summary[:header] = ['Description','Count']
4739
- measure_table_summary[:data] = []
4740
-
4741
- # add summary rows
4742
- measure_table_summary[:data] << ['Number of measures in workflow',num_measures]
4743
- measure_table_summary[:data] << ['Number of measures with warnings',num_measures_with_warnings]
4744
- measure_table_summary[:data] << ['Total number of warnings',num_warnings]
4745
-
4746
- # add table to section
4747
- measure_tables << measure_table_summary
4748
-
4749
- runner.registerValue("number_of_measures_with_warnings", num_measures_with_warnings)
4750
- runner.registerValue("number_warnings", num_warnings)
4751
-
4752
- return @measure_warnings_section
4753
- end
4754
-
4755
- end
4652
+ end
@@ -56,18 +56,17 @@ module OpenStudio
56
56
  ##
57
57
  # @param [String] dirname Directory to run commands in, defaults to Dir.pwd. If directory includes a Gemfile then create a local bundle.
58
58
  # @param bundle_without [Hash] Hash describing the distribution of the variable.
59
- # @param options [Hash] Hash describing options for running the simulation. These are the defaults for all runs unless overriden within the run_* methods. Note if options is used, then a local runner.conf file will not be loaded.
59
+ # @param options [Hash] Hash describing options for running the simulation. These are the defaults for all runs unless overriden within the run_* methods.
60
60
  # @option options [String] :max_datapoints Max number of datapoints to run
61
61
  # @option options [String] :num_parallel Number of simulations to run in parallel at a time
62
62
  # @option options [String] :run_simulations Set to true to run the simulations
63
63
  # @option options [String] :verbose Set to true to receive extra information while running simulations
64
64
  def initialize(dirname = Dir.pwd, bundle_without = [], options = {})
65
65
  # DLM: I am not sure if we want to use the main root directory to create these bundles
66
- # had the idea of passing in a Gemfile name/alias and path to Gemfile, then doing the bundle
67
- # in ~/OpenStudio/#{alias} or something like that?
66
+ # had the idea of passing in a Gemfile name/alias and path to Gemfile, then doing the bundle in ~/OpenStudio/#{alias} or something like that?
68
67
 
69
68
  # if the dirname contains a runner.conf file, then use the config file to specify the parameters
70
- if File.exist?(File.join(dirname, OpenStudio::Extension::RunnerConfig::FILENAME)) && options.empty?
69
+ if File.exist?(File.join(dirname, OpenStudio::Extension::RunnerConfig::FILENAME)) && !options
71
70
  puts 'Using runner options from runner.conf file'
72
71
  runner_config = OpenStudio::Extension::RunnerConfig.new(dirname)
73
72
  @options = runner_config.options
@@ -104,19 +104,6 @@ module OpenStudio
104
104
  end
105
105
  end
106
106
 
107
- ##
108
- # Update a runner config value
109
- #
110
- # @param [String] key, The name of the key to update
111
- # @param [Variant] new_value, The new value to set the `key` to.
112
- def update_config(key, new_value)
113
- if @data.key? key.to_sym
114
- @data[key.to_sym] = new_value
115
- else
116
- raise "Could not find key '#{key}' to update in RunnerConfig."
117
- end
118
- end
119
-
120
107
  ##
121
108
  # Return the options as hash
122
109
  def options
@@ -35,6 +35,6 @@
35
35
 
36
36
  module OpenStudio
37
37
  module Extension
38
- VERSION = '0.1.6'.freeze
38
+ VERSION = '0.2.0'.freeze
39
39
  end
40
40
  end
@@ -5,29 +5,35 @@ require 'openstudio/extension/version'
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = 'openstudio-extension'
7
7
  spec.version = OpenStudio::Extension::VERSION
8
- spec.authors = ['Katherine Fleming', 'Nicholas Long', 'Dan Macumber']
9
- spec.email = ['katherine.fleming@nrel.gov', 'nicholas.long@nrel.gov', 'daniel.macumber@nrel.gov']
10
8
  spec.platform = Gem::Platform::RUBY
9
+ spec.authors = ['Katherine Fleming', 'Nicholas Long', 'Daniel Macumber']
10
+ spec.email = ['katherine.fleming@nrel.gov', 'nicholas.long@nrel.gov', 'daniel.macumber@nrel.gov']
11
11
 
12
+ spec.homepage = 'https://openstudio.net'
12
13
  spec.summary = 'openstudio base gem for creating generic extensions with encapsulated data and measures.'
13
14
  spec.description = 'openstudio base gem for creating generic extensions with encapsulated data and measures.'
14
- spec.homepage = 'https://openstudio.net'
15
+ spec.metadata = {
16
+ 'bug_tracker_uri' => 'https://github.com/NREL/openstudio-extension-gem/issues',
17
+ 'changelog_uri' => 'https://github.com/NREL/openstudio-extension-gem/blob/develop/CHANGELOG.md',
18
+ #'documentation_uri' => 'https://www.rubydoc.info/gems/openstudio-extension-gem/#{gem.version}',
19
+ 'source_code_uri' => "https://github.com/NREL/openstudio-extension-gem/tree/v#{spec.version}"
20
+ }
15
21
 
16
- # Specify which files should be added to the gem when it is released.
17
- # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
18
- spec.files = Dir.chdir(File.expand_path(__dir__)) do
19
- `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
22
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
23
+ f.match(%r{^(test|spec|features)/})
20
24
  end
21
- spec.bindir = 'exe'
22
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
25
+ spec.bindir = 'exe'
26
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
23
27
  spec.require_paths = ['lib']
24
28
 
25
- spec.add_dependency 'bundler', '~> 1.9'
26
- spec.add_dependency 'json_pure', '2.2.0'
29
+ spec.required_ruby_version = '~> 2.5.0'
30
+
31
+ spec.add_dependency 'bundler', '~> 2.1'
27
32
  spec.add_dependency 'openstudio-workflow', '~> 1.3.4'
28
- spec.add_dependency 'openstudio_measure_tester', '~> 0.1.7'
33
+ spec.add_dependency 'openstudio_measure_tester', '~> 0.2.0'
29
34
  spec.add_dependency 'parallel', '~> 1.12.0'
30
35
 
36
+ spec.add_development_dependency 'github_api', '~> 0.18.0'
31
37
  spec.add_development_dependency 'rake', '~> 12.3'
32
38
  spec.add_development_dependency 'rspec', '~> 3.7'
33
39
  spec.add_development_dependency 'rubocop', '~> 0.54.0'
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openstudio-extension
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Katherine Fleming
8
8
  - Nicholas Long
9
- - Dan Macumber
9
+ - Daniel Macumber
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2020-02-28 00:00:00.000000000 Z
13
+ date: 2020-02-18 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: bundler
@@ -18,70 +18,70 @@ dependencies:
18
18
  requirements:
19
19
  - - "~>"
20
20
  - !ruby/object:Gem::Version
21
- version: '1.9'
21
+ version: '2.1'
22
22
  type: :runtime
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements:
26
26
  - - "~>"
27
27
  - !ruby/object:Gem::Version
28
- version: '1.9'
28
+ version: '2.1'
29
29
  - !ruby/object:Gem::Dependency
30
- name: json_pure
30
+ name: openstudio-workflow
31
31
  requirement: !ruby/object:Gem::Requirement
32
32
  requirements:
33
- - - '='
33
+ - - "~>"
34
34
  - !ruby/object:Gem::Version
35
- version: 2.2.0
35
+ version: 1.3.4
36
36
  type: :runtime
37
37
  prerelease: false
38
38
  version_requirements: !ruby/object:Gem::Requirement
39
39
  requirements:
40
- - - '='
40
+ - - "~>"
41
41
  - !ruby/object:Gem::Version
42
- version: 2.2.0
42
+ version: 1.3.4
43
43
  - !ruby/object:Gem::Dependency
44
- name: openstudio-workflow
44
+ name: openstudio_measure_tester
45
45
  requirement: !ruby/object:Gem::Requirement
46
46
  requirements:
47
47
  - - "~>"
48
48
  - !ruby/object:Gem::Version
49
- version: 1.3.4
49
+ version: 0.2.0
50
50
  type: :runtime
51
51
  prerelease: false
52
52
  version_requirements: !ruby/object:Gem::Requirement
53
53
  requirements:
54
54
  - - "~>"
55
55
  - !ruby/object:Gem::Version
56
- version: 1.3.4
56
+ version: 0.2.0
57
57
  - !ruby/object:Gem::Dependency
58
- name: openstudio_measure_tester
58
+ name: parallel
59
59
  requirement: !ruby/object:Gem::Requirement
60
60
  requirements:
61
61
  - - "~>"
62
62
  - !ruby/object:Gem::Version
63
- version: 0.1.7
63
+ version: 1.12.0
64
64
  type: :runtime
65
65
  prerelease: false
66
66
  version_requirements: !ruby/object:Gem::Requirement
67
67
  requirements:
68
68
  - - "~>"
69
69
  - !ruby/object:Gem::Version
70
- version: 0.1.7
70
+ version: 1.12.0
71
71
  - !ruby/object:Gem::Dependency
72
- name: parallel
72
+ name: github_api
73
73
  requirement: !ruby/object:Gem::Requirement
74
74
  requirements:
75
75
  - - "~>"
76
76
  - !ruby/object:Gem::Version
77
- version: 1.12.0
78
- type: :runtime
77
+ version: 0.18.0
78
+ type: :development
79
79
  prerelease: false
80
80
  version_requirements: !ruby/object:Gem::Requirement
81
81
  requirements:
82
82
  - - "~>"
83
83
  - !ruby/object:Gem::Version
84
- version: 1.12.0
84
+ version: 0.18.0
85
85
  - !ruby/object:Gem::Dependency
86
86
  name: rake
87
87
  requirement: !ruby/object:Gem::Requirement
@@ -158,6 +158,7 @@ files:
158
158
  - init_templates/template_gemfile.txt
159
159
  - init_templates/template_rakefile.txt
160
160
  - init_templates/version.rb
161
+ - lib/change_log.rb
161
162
  - lib/files/openstudio-extension-gem-test.ddy
162
163
  - lib/files/openstudio-extension-gem-test.epw
163
164
  - lib/files/openstudio-extension-gem-test.stat
@@ -197,6 +198,7 @@ files:
197
198
  - lib/openstudio/extension/core/check_weather_files.rb
198
199
  - lib/openstudio/extension/core/deer_vintages.rb
199
200
  - lib/openstudio/extension/core/os_lib_aedg_measures.rb
201
+ - lib/openstudio/extension/core/os_lib_cofee.rb
200
202
  - lib/openstudio/extension/core/os_lib_constructions.rb
201
203
  - lib/openstudio/extension/core/os_lib_geometry.rb
202
204
  - lib/openstudio/extension/core/os_lib_helper_methods.rb
@@ -215,16 +217,19 @@ files:
215
217
  - openstudio-extension.gemspec
216
218
  homepage: https://openstudio.net
217
219
  licenses: []
218
- metadata: {}
220
+ metadata:
221
+ bug_tracker_uri: https://github.com/NREL/openstudio-extension-gem/issues
222
+ changelog_uri: https://github.com/NREL/openstudio-extension-gem/blob/develop/CHANGELOG.md
223
+ source_code_uri: https://github.com/NREL/openstudio-extension-gem/tree/v0.2.0
219
224
  post_install_message:
220
225
  rdoc_options: []
221
226
  require_paths:
222
227
  - lib
223
228
  required_ruby_version: !ruby/object:Gem::Requirement
224
229
  requirements:
225
- - - ">="
230
+ - - "~>"
226
231
  - !ruby/object:Gem::Version
227
- version: '0'
232
+ version: 2.5.0
228
233
  required_rubygems_version: !ruby/object:Gem::Requirement
229
234
  requirements:
230
235
  - - ">="
@@ -232,7 +237,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
232
237
  version: '0'
233
238
  requirements: []
234
239
  rubyforge_project:
235
- rubygems_version: 2.4.5.1
240
+ rubygems_version: 2.7.6
236
241
  signing_key:
237
242
  specification_version: 4
238
243
  summary: openstudio base gem for creating generic extensions with encapsulated data