Skip to content

Commit

Permalink
Merge pull request #91 from urbanopt/develop
Browse files Browse the repository at this point in the history
release
  • Loading branch information
kflemin authored Oct 19, 2021
2 parents 5e0a3e3 + 6f36ef8 commit 5c6e066
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# URBANopt Reporting Gem

## Version 0.4.2
Date Range: 07/01/21 - 10/15/21

- Fixed [#86]( https://github.com/urbanopt/urbanopt-reporting-gem/issues/86 ), Add location of PV to Scenario and Feature optimization reopt reports #86
- Fixed [#77]( https://github.com/urbanopt/urbanopt-reporting-gem/issues/77 ), Fix test_with_openstudio model failures

## Version 0.4.1
Date Range: 04/27/23 - 07/01/21

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,15 @@
"size_kw": {
"description": "rated power in kW",
"type": "string"
},
"location": {
"description": "Location of PV. Available options are roof, ground or both.",
"type": "string",
"enum": [
"roof",
"ground",
"both"
]
}
}
},
Expand Down
3 changes: 3 additions & 0 deletions lib/urbanopt/reporting/default_reports/solar_pv.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ class SolarPV
# _Float_ - power capacity in kilowatts
#
attr_accessor :size_kw
attr_accessor :location

##
# Initialize SolarPV attributes from a hash. Solar PV attributes currently are limited to power capacity.
Expand All @@ -65,6 +66,7 @@ def initialize(hash = {})

@size_kw = hash[:size_kw]
@id = hash[:id]
@location = hash[:location]

# initialize class variables @@validator and @@schema
@@validator ||= Validator.new
Expand All @@ -81,6 +83,7 @@ def to_hash
result = {}

result[:size_kw] = @size_kw if @size_kw
result[:location] = @location if @location

return result
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 @@ -40,6 +40,6 @@

module URBANopt
module Reporting
VERSION = '0.4.1'.freeze
VERSION = '0.4.2'.freeze
end
end
7 changes: 7 additions & 0 deletions spec/urbanopt/reporting/reporting_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -243,4 +243,11 @@

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

it 'can report solarPV results' do
solar_pv = URBANopt::Reporting::DefaultReports::SolarPV.new({ size_kw: 100, id: 1, location: 'roof' })
expect(solar_pv.size_kw).to eq 100
expect(solar_pv.location).to eq 'roof'
end

end

0 comments on commit 5c6e066

Please sign in to comment.