Skip to content

Commit

Permalink
Merge pull request #34 from urbanopt/develop
Browse files Browse the repository at this point in the history
Version 0.3.2
  • Loading branch information
kflemin authored Dec 9, 2020
2 parents f60bd84 + 5477f70 commit cfc0c67
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 31 deletions.
12 changes: 10 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down Expand Up @@ -43,4 +51,4 @@ Date Range: 08/27/2020 - 09/21/2020

08/17/2020

Initial release of the urbanopt-reporting gem.
Initial release of the urbanopt-reporting gem.
6 changes: 3 additions & 3 deletions docs/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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://[email protected]/bgschiller/json-schema-view-js.git",
"vuepress": "^1.7.1",
Expand Down
18 changes: 9 additions & 9 deletions lib/measures/default_feature_reports/measure.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions lib/measures/default_feature_reports/measure.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
<schema_version>3.0</schema_version>
<name>default_feature_reports</name>
<uid>9ee3135a-8070-4408-bfa1-b75fecf9dd4f</uid>
<version_id>f9af7bd8-e9ce-41b4-b892-df29f235a9bd</version_id>
<version_modified>20201201T173130Z</version_modified>
<version_id>d4f5b2e2-f93d-4ce2-9c68-ed29714fdc0c</version_id>
<version_modified>20201208T230102Z</version_modified>
<xml_checksum>FB304155</xml_checksum>
<class_name>DefaultFeatureReports</class_name>
<display_name>DefaultFeatureReports</display_name>
Expand Down Expand Up @@ -153,7 +153,7 @@
<filename>measure.rb</filename>
<filetype>rb</filetype>
<usage_type>script</usage_type>
<checksum>B1E43E26</checksum>
<checksum>48AEB753</checksum>
</file>
</files>
</measure>
Expand Down
6 changes: 2 additions & 4 deletions lib/urbanopt/reporting/default_reports/feature_report.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
##
Expand Down Expand Up @@ -263,7 +263,6 @@ def save_json_report(file_name = 'default_feature_report')
f.flush
end
end

end

##
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/urbanopt/reporting/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@

module URBANopt
module Reporting
VERSION = '0.3.1'.freeze
VERSION = '0.3.2'.freeze
end
end
13 changes: 6 additions & 7 deletions spec/urbanopt/reporting/reporting_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down Expand Up @@ -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}"
Expand Down Expand Up @@ -232,5 +232,4 @@

# puts "\nfinal periods: #{existing_periods}"
end

end
2 changes: 1 addition & 1 deletion urbanopt-reporting-gem.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit cfc0c67

Please sign in to comment.