urbanopt-scenario 0.3.0.pre1 → 0.3.0

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: 6f3b7d2011137b207de9f896a21ec59a4aaf58d730b5ddf6d0044487fa5c52e3
4
- data.tar.gz: ee379c34924b4a6217434ce6e57500674ac5a158c69fcb939cb2730c65377c77
3
+ metadata.gz: f93b1a5a10c8bbbc7e9c2b24e1ba08b78ebefdd3cd9b63bb0c5221cc52bef70f
4
+ data.tar.gz: 2cda8b296e36d810d0c581b1e9b40432e68a8d356681cc2b3dbebf29a036bdcc
5
5
  SHA512:
6
- metadata.gz: 06fc50c836b10099c13c05329f815db355940733f7fbc39979688c7fbb9e4a2732f0d303b969a3be9d16166f3996bdeccd91b339f366a20fc4761d81228af484
7
- data.tar.gz: 29f0f9becdd8b064bbc5d2e36bc7bd031e221fc2bef185dc15160057cab22f3c0472cd5dfaebc8999e3db6fa0149b58a5c9383b4e64f374f8493ef256ec53cd6
6
+ metadata.gz: 0dd003e6dce979401fc293f3b5df0f1bcedaa095442daf0050515eb34eece41eebacea7b380dfd07f90e315399df9ffbedfa5badce30a066301fff0fbae9be90
7
+ data.tar.gz: d4b7f9ac5b19526a545c77185234c5aa65ff918d47056824e703460b8908097ed643549e5a9a6db6b1ba47789c2329b0e49bc6bed56819721f36733d65c45306
@@ -1,13 +1,15 @@
1
1
  # URBANopt Scenario Gem
2
2
 
3
- ## Version 0.3.0.pre1
4
- Date Range: 04/01/20 - 05/18/20:
3
+ ## Version 0.3.0
4
+ Date Range: 04/01/20 - 06/04/20:
5
5
 
6
6
  Updating to OpenStudio 3.0 and Ruby 2.5
7
7
 
8
8
  - Fixed [#114]( https://github.com/urbanopt/urbanopt-scenario-gem/pull/114 ), Bug fix
9
9
  - Fixed [#117]( https://github.com/urbanopt/urbanopt-scenario-gem/pull/117 ), Added utility cost outputs to reports
10
10
  - Fixed [#118]( https://github.com/urbanopt/urbanopt-scenario-gem/pull/118 ), test Jenkins using pipeline to run OpenStudio 3.0.0
11
+ - Fixed [#119]( https://github.com/urbanopt/urbanopt-scenario-gem/pull/119 ), added timeseries outputs for heat rejection end uses
12
+ - Fixed [#120]( https://github.com/urbanopt/urbanopt-scenario-gem/pull/120 ), Bug fix r
11
13
 
12
14
  ## Version 0.2.0
13
15
 
@@ -2,4 +2,4 @@ AllCops:
2
2
  Exclude:
3
3
  - 'spec/test_measures/**/*'
4
4
  inherit_from:
5
- - http://s3.amazonaws.com/openstudio-resources/styles/rubocop.yml
5
+ - http://s3.amazonaws.com/openstudio-resources/styles/rubocop_v3.yml
@@ -2,16 +2,16 @@
2
2
 
3
3
  ###### (Automatically generated documentation)
4
4
 
5
- # DefaultFeatureReports
5
+ #
6
6
 
7
7
  ## Description
8
- Writes default_feature_reports.json and default_feature_reports.csv files used by URBANopt Scenario Default Post Processor
8
+
9
9
 
10
10
  ## Modeler Description
11
- This measure only allows for one feature_report per simulation. If multiple features are simulated in a single simulation, a new measure must be written to disaggregate simulation results to multiple features.
11
+
12
12
 
13
13
  ## Measure Type
14
- ReportingMeasure
14
+ ModelMeasure
15
15
 
16
16
  ## Taxonomy
17
17
 
@@ -19,38 +19,8 @@ ReportingMeasure
19
19
  ## Arguments
20
20
 
21
21
 
22
- ### Feature unique identifier
23
-
24
- **Name:** feature_id,
25
- **Type:** String,
26
- **Units:** ,
27
- **Required:** false,
28
- **Model Dependent:** false
29
-
30
- ### Feature scenario specific name
31
-
32
- **Name:** feature_name,
33
- **Type:** String,
34
- **Units:** ,
35
- **Required:** false,
36
- **Model Dependent:** false
37
-
38
- ### URBANopt Feature Type
39
-
40
- **Name:** feature_type,
41
- **Type:** String,
42
- **Units:** ,
43
- **Required:** false,
44
- **Model Dependent:** false
45
-
46
- ### Reporting Frequency
47
- The frequency at which to report timeseries output data.
48
- **Name:** reporting_frequency,
49
- **Type:** Choice,
50
- **Units:** ,
51
- **Required:** true,
52
- **Model Dependent:** false
53
22
 
54
23
 
24
+ This measure does not have any user arguments
55
25
 
56
26
 
@@ -185,15 +185,14 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
185
185
  # result << OpenStudio::IdfObject.load("Output:Meter:MeterFileOnly,Heating:Gas,#{reporting_frequency};").get
186
186
  # result << OpenStudio::IdfObject.load("Output:Meter:MeterFileOnly,WaterSystems:Gas,#{reporting_frequency};").get
187
187
  # result << OpenStudio::IdfObject.load("Output:Meter:MeterFileOnly,InteriorEquipment:Gas,#{reporting_frequency};").get
188
- result << OpenStudio::IdfObject.load("Output:Variable,*,Heating Coil Heating Rate,hourly; !- HVAC Average [W];").get
188
+ result << OpenStudio::IdfObject.load('Output:Variable,*,Heating Coil Heating Rate,hourly; !- HVAC Average [W];').get
189
189
 
190
190
  timeseries_data = ['District Cooling Chilled Water Rate', 'District Cooling Mass Flow Rate',
191
191
  'District Cooling Inlet Temperature', 'District Cooling Outlet Temperature',
192
192
  'District Heating Hot Water Rate', 'District Heating Mass Flow Rate',
193
- 'District Heating Inlet Temperature', 'District Heating Outlet Temperature','Cooling Coil Total Cooling Rate',
193
+ 'District Heating Inlet Temperature', 'District Heating Outlet Temperature', 'Cooling Coil Total Cooling Rate',
194
194
  'Heating Coil Heating Rate']
195
195
 
196
-
197
196
  timeseries_data.each do |ts|
198
197
  result << OpenStudio::IdfObject.load("Output:Variable,*,#{ts},#{reporting_frequency};").get
199
198
  end
@@ -588,8 +587,8 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
588
587
 
589
588
  ## Total utility cost
590
589
  total_utility_cost = sql_query(runner, sql_file, 'Economics Results Summary Report', "TableName='Annual Cost' AND RowName='Cost' AND ColumnName='Total'")
591
- feature_report.reporting_periods[0].total_utility_cost = total_utility_cost
592
-
590
+ feature_report.reporting_periods[0].total_utility_cost = total_utility_cost
591
+
593
592
  ## Utility Costs
594
593
  # electricity utility cost
595
594
  elec_utility_cost = sql_query(runner, sql_file, 'Economics Results Summary Report', "TableName='Annual Cost' AND RowName='Cost' AND ColumnName='Electric'")
@@ -597,8 +596,8 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
597
596
  feature_report.reporting_periods[0].utility_costs[0][:total_cost] = elec_utility_cost
598
597
  # gas utility cost
599
598
  gas_utility_cost = sql_query(runner, sql_file, 'Economics Results Summary Report', "TableName='Annual Cost' AND RowName='Cost' AND ColumnName='Gas'")
600
- feature_report.reporting_periods[0].utility_costs << {:fuel_type => 'Natural Gas', :total_cost => gas_utility_cost}
601
-
599
+ feature_report.reporting_periods[0].utility_costs << { fuel_type: 'Natural Gas', total_cost: gas_utility_cost }
600
+
602
601
  ## comfort_result
603
602
  # time_setpoint_not_met_during_occupied_cooling
604
603
  time_setpoint_not_met_during_occupied_cooling = sql_query(runner, sql_file, 'AnnualBuildingUtilityPerformanceSummary', "TableName='Comfort and Setpoint Not Met Summary' AND RowName='Time Setpoint Not Met During Occupied Cooling' AND ColumnName='Facility'")
@@ -643,6 +642,8 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
643
642
  'Fans:Electricity',
644
643
  'Pumps:Electricity',
645
644
  'WaterSystems:Electricity',
645
+ 'HeatRejection:Electricity',
646
+ 'HeatRejection:Gas',
646
647
  'Heating:Gas',
647
648
  'WaterSystems:Gas',
648
649
  'InteriorEquipment:Gas',
@@ -655,7 +656,7 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
655
656
  'District Heating Hot Water Rate',
656
657
  'District Heating Mass Flow Rate',
657
658
  'District Heating Inlet Temperature',
658
- 'District Heating Outlet Temperature',
659
+ 'District Heating Outlet Temperature',
659
660
  'Cooling Coil Total Cooling Rate',
660
661
  'Heating Coil Heating Rate'
661
662
  ]
@@ -700,9 +701,9 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
700
701
  final_timeseries_names = []
701
702
 
702
703
  # loop over requested timeseries
703
- # rubocop: disable Metrics/BlockLength
704
704
  requested_timeseries_names.each_index do |i|
705
705
  timeseries_name = requested_timeseries_names[i]
706
+ puts " *********timeseries_name = #{timeseries_name}******************"
706
707
  runner.registerInfo("TIMESERIES: #{timeseries_name}")
707
708
 
708
709
  # get all the key values that this timeseries can be reported for (e.g. if PMV is requested for each zone)
@@ -782,13 +783,13 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
782
783
  'W'
783
784
  end
784
785
  end
785
-
786
+
786
787
  # loop through each value and apply unit conversion
787
788
  os_vec = values[key_cnt]
788
789
  if !timeseries_name.include? 'Zone Thermal Comfort'
789
790
  for i in 0..os_vec.length - 1
790
791
 
791
- unless new_unit == old_unit || old_unit.nil? || new_unit.nil? || !ts.is_initialized
792
+ unless new_unit == old_unit || old_unit.nil? || new_unit.nil? || !ts.is_initialized
792
793
  os_vec[i] = OpenStudio.convert(os_vec[i], old_unit, new_unit).get
793
794
  end
794
795
 
@@ -937,12 +938,19 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
937
938
  datetimes = []
938
939
  # check what timeseries is available
939
940
  available_ts = sql_file.availableTimeSeries
940
-
941
+ puts "####### available_ts = #{available_ts}"
941
942
  # get the timeseries for any of available timeseries
942
943
  # RK: code enhancement needed
943
- ts_d = sql_file.timeSeries(ann_env_pd.to_s, reporting_frequency.to_s, available_ts[2], '')
944
-
945
- timeseries_d = ts_d.get
944
+ ts_d_e = sql_file.timeSeries(ann_env_pd.to_s, reporting_frequency.to_s, 'Electricity:Facility', '')
945
+ ts_d_g = sql_file.timeSeries(ann_env_pd.to_s, reporting_frequency.to_s, 'Gas:Facility', '')
946
+
947
+ if ts_d_e.is_initialized
948
+ timeseries_d = ts_d_e.get
949
+ elsif ts_d_g.is_initialized
950
+ timeseries_d = ts_d_g.get
951
+ else
952
+ raise 'ELECTRICITY and GAS results are not initiaized'
953
+ end
946
954
  # get formated datetimes
947
955
  timeseries_d.dateTimes.each do |datetime|
948
956
  datetimes << format_datetime(datetime.to_s)
@@ -952,7 +960,6 @@ class DefaultFeatureReports < OpenStudio::Measure::ReportingMeasure
952
960
  # insert datetime header to names
953
961
  final_timeseries_names.insert(0, 'Datetime')
954
962
 
955
-
956
963
  # rubocop: enable Metrics/BlockLength
957
964
  runner.registerInfo("new final_timeseries_names size: #{final_timeseries_names.size}")
958
965
 
@@ -1,9 +1,10 @@
1
+ <?xml version="1.0"?>
1
2
  <measure>
2
3
  <schema_version>3.0</schema_version>
3
4
  <name>default_feature_reports</name>
4
5
  <uid>9ee3135a-8070-4408-bfa1-b75fecf9dd4f</uid>
5
- <version_id>dcf043ff-d992-4835-893d-8658a6365eb3</version_id>
6
- <version_modified>20200329T155122Z</version_modified>
6
+ <version_id>95706c7a-88ab-433b-b897-00435181a6dd</version_id>
7
+ <version_modified>20200603T001228Z</version_modified>
7
8
  <xml_checksum>FB304155</xml_checksum>
8
9
  <class_name>DefaultFeatureReports</class_name>
9
10
  <display_name>DefaultFeatureReports</display_name>
@@ -13,32 +14,45 @@
13
14
  <argument>
14
15
  <name>feature_id</name>
15
16
  <display_name>Feature unique identifier</display_name>
17
+ <description></description>
16
18
  <type>String</type>
19
+ <units></units>
17
20
  <required>false</required>
18
21
  <model_dependent>false</model_dependent>
19
22
  <default_value>1</default_value>
23
+ <min_value></min_value>
24
+ <max_value></max_value>
20
25
  </argument>
21
26
  <argument>
22
27
  <name>feature_name</name>
23
28
  <display_name>Feature scenario specific name</display_name>
29
+ <description></description>
24
30
  <type>String</type>
31
+ <units></units>
25
32
  <required>false</required>
26
33
  <model_dependent>false</model_dependent>
27
34
  <default_value>name</default_value>
35
+ <min_value></min_value>
36
+ <max_value></max_value>
28
37
  </argument>
29
38
  <argument>
30
39
  <name>feature_type</name>
31
40
  <display_name>URBANopt Feature Type</display_name>
41
+ <description></description>
32
42
  <type>String</type>
43
+ <units></units>
33
44
  <required>false</required>
34
45
  <model_dependent>false</model_dependent>
35
46
  <default_value>Building</default_value>
47
+ <min_value></min_value>
48
+ <max_value></max_value>
36
49
  </argument>
37
50
  <argument>
38
51
  <name>reporting_frequency</name>
39
52
  <display_name>Reporting Frequency</display_name>
40
53
  <description>The frequency at which to report timeseries output data.</description>
41
54
  <type>Choice</type>
55
+ <units></units>
42
56
  <required>true</required>
43
57
  <model_dependent>false</model_dependent>
44
58
  <default_value>Timestep</default_value>
@@ -72,10 +86,12 @@
72
86
  <display_name>Runperiod</display_name>
73
87
  </choice>
74
88
  </choices>
89
+ <min_value></min_value>
90
+ <max_value></max_value>
75
91
  </argument>
76
92
  </arguments>
77
- <outputs/>
78
- <provenances/>
93
+ <outputs />
94
+ <provenances />
79
95
  <tags>
80
96
  <tag>Reporting.QAQC</tag>
81
97
  </tags>
@@ -122,12 +138,6 @@
122
138
  <usage_type>test</usage_type>
123
139
  <checksum>56E0804B</checksum>
124
140
  </file>
125
- <file>
126
- <filename>README.md</filename>
127
- <filetype>md</filetype>
128
- <usage_type>readme</usage_type>
129
- <checksum>5C1DD676</checksum>
130
- </file>
131
141
  <file>
132
142
  <version>
133
143
  <software_program>OpenStudio</software_program>
@@ -137,7 +147,14 @@
137
147
  <filename>measure.rb</filename>
138
148
  <filetype>rb</filetype>
139
149
  <usage_type>script</usage_type>
140
- <checksum>DF6AAD06</checksum>
150
+ <checksum>A00C8077</checksum>
151
+ </file>
152
+ <file>
153
+ <filename>README.md</filename>
154
+ <filetype>md</filetype>
155
+ <usage_type>readme</usage_type>
156
+ <checksum>0B68E96D</checksum>
141
157
  </file>
142
158
  </files>
143
159
  </measure>
160
+ <error>wrong number of arguments (given 1, expected 0)</error>
@@ -219,7 +219,6 @@ module URBANopt
219
219
  # [parameters:]
220
220
  # +other+ - _Program_ - An object of Program class.
221
221
  ##
222
- # rubocop:disable Metrics/AbcSize # :nodoc:
223
222
  def add_program(other)
224
223
  @site_area = add_values(@site_area, other.site_area)
225
224
 
@@ -44,7 +44,7 @@ module URBANopt
44
44
  class ReportingPeriod
45
45
  attr_accessor :id, :name, :multiplier, :start_date, :end_date, :month, :day_of_month, :year, :total_site_energy, :total_source_energy,
46
46
  :net_site_energy, :net_source_energy, :total_utility_cost, :net_utility_cost, :utility_costs, :electricity, :natural_gas, :additional_fuel, :district_cooling,
47
- :district_heating, :water, :electricity_produced, :end_uses, :energy_production, :photovoltaic,
47
+ :district_heating, :water, :electricity_produced, :end_uses, :energy_production, :photovoltaic,
48
48
  :fuel_type, :total_cost, :usage_cost, :demand_cost, :comfort_result, :time_setpoint_not_met_during_occupied_cooling,
49
49
  :time_setpoint_not_met_during_occupied_heating, :time_setpoint_not_met_during_occupied_hours, :hours_out_of_comfort_bounds_PMV, :hours_out_of_comfort_bounds_PPD #:nodoc:
50
50
  # ReportingPeriod class initializes the reporting period attributes:
@@ -208,7 +208,6 @@ module URBANopt
208
208
  ##
209
209
  # +new_period+ - _ReportingPeriod_ - An object of ReportingPeriod class.
210
210
  ##
211
- # rubocop: disable Metrics/AbcSize
212
211
  def self.merge_reporting_period(existing_period, new_period)
213
212
  # modify the existing_period by summing up the results
214
213
  existing_period.total_site_energy = add_values(existing_period.total_site_energy, new_period.total_site_energy)
@@ -235,7 +234,7 @@ module URBANopt
235
234
  end
236
235
 
237
236
  if existing_period.utility_costs
238
- #RK: this need to be updated
237
+ # RK: this need to be updated
239
238
  existing_period.utility_costs.each_with_index do |item, i|
240
239
  existing_period.utility_costs[i][:fuel_type] = existing_period.utility_costs[i][:fuel_type]
241
240
  existing_period.utility_costs[i][:total_cost] = add_values(existing_period.utility_costs[i][:total_cost], new_period.utility_costs[i][:total_cost])
@@ -10,6 +10,8 @@ InteriorEquipment:Electricity
10
10
  Fans:Electricity
11
11
  Pumps:Electricity
12
12
  WaterSystems:Electricity
13
+ HeatRejection:Electricity
14
+ HeatRejection:Gas
13
15
  Heating:Gas
14
16
  WaterSystems:Gas
15
17
  InteriorEquipment:Gas
@@ -132,8 +132,6 @@ module URBANopt
132
132
  return result
133
133
  end
134
134
 
135
- # rubocop: disable Metrics/AbcSize #:nodoc:
136
-
137
135
  ##
138
136
  # Return true if the simulation is out of date (input files newer than results), false otherwise.
139
137
  # Non-existant simulation input files are out of date.
@@ -199,8 +197,6 @@ module URBANopt
199
197
  end
200
198
  # rubocop: enable Metrics/AbcSize #:nodoc:
201
199
 
202
- # rubocop: disable Style/GuardClause #:nodoc:
203
-
204
200
  ##
205
201
  # Return simulation status one of {'Not Started', 'Started', 'Complete', 'Failed'}
206
202
  ##
@@ -30,6 +30,6 @@
30
30
 
31
31
  module URBANopt
32
32
  module Scenario
33
- VERSION = '0.3.0.pre1'.freeze
33
+ VERSION = '0.3.0'.freeze
34
34
  end
35
35
  end
@@ -16,7 +16,7 @@ Gem::Specification.new do |spec|
16
16
  # Specify which files should be added to the gem when it is released.
17
17
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
18
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)/}) }
19
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|lib.measures.*tests|spec|features)/}) }
20
20
  end
21
21
  spec.bindir = 'exe'
22
22
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
@@ -31,9 +31,6 @@ Gem::Specification.new do |spec|
31
31
  spec.add_dependency 'json_pure'
32
32
  spec.add_dependency 'openstudio-common-measures', '~> 0.2.0'
33
33
  spec.add_dependency 'openstudio-model-articulation', '~> 0.2.0'
34
- spec.add_dependency 'urbanopt-core', '~> 0.3.0.pre2'
34
+ spec.add_dependency 'urbanopt-core', '~> 0.3.0'
35
35
 
36
- # lock the version of these dependencies due to using older version of Ruby.
37
- # spec.add_dependency 'public_suffix', '3.1.1'
38
- # spec.add_development_dependency 'rack', '2.1.2'
39
36
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: urbanopt-scenario
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0.pre1
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rawad El Kontar
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2020-05-19 00:00:00.000000000 Z
12
+ date: 2020-06-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -115,14 +115,14 @@ dependencies:
115
115
  requirements:
116
116
  - - "~>"
117
117
  - !ruby/object:Gem::Version
118
- version: 0.3.0.pre2
118
+ version: 0.3.0
119
119
  type: :runtime
120
120
  prerelease: false
121
121
  version_requirements: !ruby/object:Gem::Requirement
122
122
  requirements:
123
123
  - - "~>"
124
124
  - !ruby/object:Gem::Version
125
- version: 0.3.0.pre2
125
+ version: 0.3.0
126
126
  description: Library to export data point OSW files from URBANopt Scenario CSV
127
127
  email:
128
128
  - rawad.elkontar@nrel.gov
@@ -170,9 +170,6 @@ files:
170
170
  - lib/measures/default_feature_reports/README.md.erb
171
171
  - lib/measures/default_feature_reports/measure.rb
172
172
  - lib/measures/default_feature_reports/measure.xml
173
- - lib/measures/default_feature_reports/tests/USA_CO_Golden-NREL.724666_TMY3.epw
174
- - lib/measures/default_feature_reports/tests/default_feature_reports_test.rb
175
- - lib/measures/default_feature_reports/tests/example_model.osm
176
173
  - lib/urbanopt-scenario.rb
177
174
  - lib/urbanopt/scenario.rb
178
175
  - lib/urbanopt/scenario/default_reports.rb
@@ -226,9 +223,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
226
223
  version: 2.5.0
227
224
  required_rubygems_version: !ruby/object:Gem::Requirement
228
225
  requirements:
229
- - - ">"
226
+ - - ">="
230
227
  - !ruby/object:Gem::Version
231
- version: 1.3.1
228
+ version: '0'
232
229
  requirements: []
233
230
  rubygems_version: 3.1.2
234
231
  signing_key: