diff --git a/CHANGELOG.md b/CHANGELOG.md
index a1e736d..1d57889 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,13 @@
# URBANopt Reporting Gem
+## Version 0.3.2
+
+Date Range: 12/07/20 - 12/08/20
+
+- Fixed [#27]( https://github.com/urbanopt/urbanopt-reporting-gem/issues/27 ), reporting measure fails when there are no additional fuels in the model
+- Fixed [#29]( https://github.com/urbanopt/urbanopt-reporting-gem/issues/29 ), restore save_feature_report function for backward compatibility
+- Fixed [#32]( https://github.com/urbanopt/urbanopt-reporting-gem/issues/32 ), bump extension-gem dependency
+
## Version 0.3.1
Date Range: 11/26/2020 - 12/07/2020
@@ -11,7 +19,7 @@ Date Range: 11/26/2020 - 12/07/2020
## Version 0.3.0
Date Range: 11/12/2020 - 11/25/2020
-
+
- Updating dependencies to support OpenStudio 3.1.0
## Version 0.2.1
@@ -43,4 +51,4 @@ Date Range: 08/27/2020 - 09/21/2020
08/17/2020
-Initial release of the urbanopt-reporting gem.
\ No newline at end of file
+Initial release of the urbanopt-reporting gem.
diff --git a/docs/package-lock.json b/docs/package-lock.json
index 31f636e..2baa8af 100644
--- a/docs/package-lock.json
+++ b/docs/package-lock.json
@@ -4814,9 +4814,9 @@
"integrity": "sha512-l9sfDFsuqtOqKDsQdqrMRk0U85RZc0RtOR9yPI7mRVOa4FsR/BVnZ0shmQRM96Ji99kYZP/7hn1cedc1+ApsTQ=="
},
"highlight.js": {
- "version": "10.3.1",
- "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.3.1.tgz",
- "integrity": "sha512-jeW8rdPdhshYKObedYg5XGbpVgb1/DT4AHvDFXhkU7UnGSIjy9kkJ7zHG7qplhFHMitTSzh5/iClKQk3Kb2RFQ=="
+ "version": "10.4.1",
+ "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.4.1.tgz",
+ "integrity": "sha512-yR5lWvNz7c85OhVAEAeFhVCc/GV4C30Fjzc/rCP0aCWzc1UUOPUk55dK/qdwTZHBvMZo+eZ2jpk62ndX/xMFlg=="
},
"hmac-drbg": {
"version": "1.0.1",
diff --git a/docs/package.json b/docs/package.json
index 7659fbb..780a79f 100644
--- a/docs/package.json
+++ b/docs/package.json
@@ -10,7 +10,7 @@
},
"author": "NREL",
"dependencies": {
- "highlight.js": "^10.3.1",
+ "highlight.js": "^10.4.1",
"json-schema-ref-parser": "^9.0.6",
"json-schema-view-js": "git+https://git@github.com/bgschiller/json-schema-view-js.git",
"vuepress": "^1.7.1",
diff --git a/lib/measures/default_feature_reports/measure.rb b/lib/measures/default_feature_reports/measure.rb
index c6f62cb..7f08037 100644
--- a/lib/measures/default_feature_reports/measure.rb
+++ b/lib/measures/default_feature_reports/measure.rb
@@ -165,9 +165,9 @@ def energyPlusOutputRequests(runner, user_arguments)
# Request the output for each end use/fuel type combination
end_uses.each do |end_use|
- end_use, _ = end_use
+ end_use, = end_use
fuel_types.each do |fuel_type|
- fuel_type, _ = fuel_type
+ fuel_type, = fuel_type
variable_name = if end_use == 'Facility'
"#{fuel_type}:#{end_use}"
else
@@ -178,17 +178,17 @@ def energyPlusOutputRequests(runner, user_arguments)
end
# OtherFuels
- other_fuels = ["FuelOil#1", "Diesel", "Gasoline", "Coal", "Steam"]
- other_fuel_uses = ["HeatRejection", "Heating", "WaterSystems", "InteriorEquipment"]
- custom_meter_facility = "Meter:Custom,OtherFuels:Facility,OtherFuel1"
+ other_fuels = ['FuelOil#1', 'Diesel', 'Gasoline', 'Coal', 'Steam']
+ other_fuel_uses = ['HeatRejection', 'Heating', 'WaterSystems', 'InteriorEquipment']
+ custom_meter_facility = 'Meter:Custom,OtherFuels:Facility,OtherFuel1'
other_fuel_uses.each do |end_use|
custom_meter = "Meter:Custom,#{end_use}:OtherFuels,OtherFuel1"
- other_fuels.each do |other_fuel|
+ other_fuels.each do |other_fuel|
result << OpenStudio::IdfObject.load("Output:Meter,#{end_use}:#{other_fuel},#{reporting_frequency};").get
custom_meter_facility += ",,#{end_use}:#{other_fuel}"
custom_meter += ",,#{end_use}:#{other_fuel}"
end
- custom_meter += ";"
+ custom_meter += ';'
result << OpenStudio::IdfObject.load(custom_meter).get
result << OpenStudio::IdfObject.load("Output:Meter,#{end_use}:OtherFuels,#{reporting_frequency};").get
end
@@ -698,7 +698,7 @@ def run(runner, user_arguments)
sql_r -= feature_report.reporting_periods[0].end_uses.fuel_oil_kwh.send(y)
end
building_types.each do |i|
- sql_r = 0.0 if (i[:building_type].include?('Single-Family Detached') && x_u.include?('district'))
+ sql_r = 0.0 if i[:building_type].include?('Single-Family Detached') && x_u.include?('district')
end
m.send("#{y}=", sql_r)
end
@@ -850,7 +850,7 @@ def run(runner, user_arguments)
puts " *********timeseries_name = #{timeseries_name}******************"
runner.registerInfo("TIMESERIES: #{timeseries_name}")
- # get all the key values that this timeseries can be reported for (e.g. if PMV is requested for each zone)
+ # get all the key values that this timeseries can be reported for (e.g. if PMV is requested for each zone)
if timeseries_name.include?('OtherFuels')
key_values = sql_file.availableKeyValues('RUN PERIOD 1', 'Zone Timestep', timeseries_name.upcase)
else
diff --git a/lib/measures/default_feature_reports/measure.xml b/lib/measures/default_feature_reports/measure.xml
index 2017857..3c3ed15 100644
--- a/lib/measures/default_feature_reports/measure.xml
+++ b/lib/measures/default_feature_reports/measure.xml
@@ -3,8 +3,8 @@
3.0
default_feature_reports
9ee3135a-8070-4408-bfa1-b75fecf9dd4f
- f9af7bd8-e9ce-41b4-b892-df29f235a9bd
- 20201201T173130Z
+ d4f5b2e2-f93d-4ce2-9c68-ed29714fdc0c
+ 20201208T230102Z
FB304155
DefaultFeatureReports
DefaultFeatureReports
@@ -153,7 +153,7 @@
measure.rb
rb
script
- B1E43E26
+ 48AEB753
diff --git a/lib/urbanopt/reporting/default_reports/feature_report.rb b/lib/urbanopt/reporting/default_reports/feature_report.rb
index 2655d17..3435f3f 100644
--- a/lib/urbanopt/reporting/default_reports/feature_report.rb
+++ b/lib/urbanopt/reporting/default_reports/feature_report.rb
@@ -223,7 +223,7 @@ def to_hash
return result
end
- ##
+ ##
# Calls the individual functions to save 'default_feature_report.json' and 'default_feature_report.csv'
# For backward compatibility and ease of use
##
@@ -263,7 +263,6 @@ def save_json_report(file_name = 'default_feature_report')
f.flush
end
end
-
end
##
@@ -286,11 +285,10 @@ def save_csv_report(file_name = 'default_feature_report')
# copy the CSV report to the new feature_reports folder
directory_folders.each do |f|
if f.include? '_default_feature_reports'
- FileUtils.cp(File.join(f, 'default_feature_reports.csv'), File.join(results_dir_path, @file_name +'.csv'))
+ FileUtils.cp(File.join(f, 'default_feature_reports.csv'), File.join(results_dir_path, @file_name + '.csv'))
end
end
end
-
end
end
end
diff --git a/lib/urbanopt/reporting/version.rb b/lib/urbanopt/reporting/version.rb
index 3fbb22f..188f2f4 100644
--- a/lib/urbanopt/reporting/version.rb
+++ b/lib/urbanopt/reporting/version.rb
@@ -30,6 +30,6 @@
module URBANopt
module Reporting
- VERSION = '0.3.1'.freeze
+ VERSION = '0.3.2'.freeze
end
end
diff --git a/spec/urbanopt/reporting/reporting_spec.rb b/spec/urbanopt/reporting/reporting_spec.rb
index 3f7b318..3556560 100644
--- a/spec/urbanopt/reporting/reporting_spec.rb
+++ b/spec/urbanopt/reporting/reporting_spec.rb
@@ -116,14 +116,14 @@
new_costs = []
new_costs << URBANopt::Reporting::DefaultReports::ConstructionCost.new(category: 'Construction', item_name: 'wall', unit_cost: 1,
- cost_units: 'CostPerEach', item_quantity: 1, total_cost: 1)
+ cost_units: 'CostPerEach', item_quantity: 1, total_cost: 1)
new_costs << URBANopt::Reporting::DefaultReports::ConstructionCost.new(category: 'Construction', item_name: 'roof', unit_cost: 1,
- cost_units: 'CostPerEach', item_quantity: 1, total_cost: 1)
+ cost_units: 'CostPerEach', item_quantity: 1, total_cost: 1)
existing_costs << URBANopt::Reporting::DefaultReports::ConstructionCost.new(category: 'Construction', item_name: 'wall', unit_cost: 1,
- cost_units: 'CostPerEach', item_quantity: 1, total_cost: 1)
+ cost_units: 'CostPerEach', item_quantity: 1, total_cost: 1)
existing_costs << URBANopt::Reporting::DefaultReports::ConstructionCost.new(category: 'HVACComponent', item_name: 'hvac', unit_cost: 1,
- cost_units: 'CostPerEach', item_quantity: 1, total_cost: 1)
+ cost_units: 'CostPerEach', item_quantity: 1, total_cost: 1)
# puts "existing_costs = #{existing_costs}"
# puts "new_costs = #{new_costs}"
@@ -190,8 +190,8 @@
end_uses: { electricity_kwh: { heating: 1, cooling: 1, fans: 1, pumps: 1 } }, utility_costs_dollar: [{ fuel_type: 'Electricity', total_cost: 1, usage_cost: 1, demand_cost: 1 }]
)
new_periods << URBANopt::Reporting::DefaultReports::ReportingPeriod.new(id: 6, name: 'January', multiplier: 1, start_date: { month: 1, day_of_month: 1, year: 2019 },
- end_date: { month: 1, day_of_month: 31, year: 2019 }, total_site_energy_kwh: 1, total_source_energy_kwh: 1,
- end_uses: { electricity_kwh: { heating: 1, cooling: 1, fans: 1, pumps: 1 } }, utility_costs_dollar: [{ fuel_type: 'Electricity', total_cost: 1, usage_cost: 1, demand_cost: 1 }])
+ end_date: { month: 1, day_of_month: 31, year: 2019 }, total_site_energy_kwh: 1, total_source_energy_kwh: 1,
+ end_uses: { electricity_kwh: { heating: 1, cooling: 1, fans: 1, pumps: 1 } }, utility_costs_dollar: [{ fuel_type: 'Electricity', total_cost: 1, usage_cost: 1, demand_cost: 1 }])
# puts "\nexisting periods: #{existing_periods}"
# puts "\nnew periods: #{new_periods}"
@@ -232,5 +232,4 @@
# puts "\nfinal periods: #{existing_periods}"
end
-
end
diff --git a/urbanopt-reporting-gem.gemspec b/urbanopt-reporting-gem.gemspec
index 4d1fd1d..58afe8b 100644
--- a/urbanopt-reporting-gem.gemspec
+++ b/urbanopt-reporting-gem.gemspec
@@ -29,5 +29,5 @@ Gem::Specification.new do |spec|
spec.add_development_dependency 'rspec', '~> 3.7'
spec.add_runtime_dependency 'json-schema', '~> 2.8'
spec.add_runtime_dependency 'json_pure', '~> 2.3'
- spec.add_runtime_dependency 'openstudio-extension', '~> 0.3.1'
+ spec.add_runtime_dependency 'openstudio-extension', '~> 0.3.2'
end