residence 0.0.14 → 0.0.15

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,18 +2,30 @@ Feature: Residence Committee Calculations
2
2
  The residence model should generate correct committee calculations
3
3
 
4
4
  Scenario Outline: Bathrooms committee
5
- Given a residence has "full_bathrooms" of "<full_baths>"
6
- And it has "half_bathrooms" of "<half_baths>"
7
- When emissions are calculated
8
- Then the bathrooms committee should be exactly <bathrooms>
5
+ Given a residence emitter
6
+ And a characteristic "full_bathrooms" of "<full_baths>"
7
+ And a characteristic "half_bathrooms" of "<half_baths>"
8
+ When the "bathrooms" committee is calculated
9
+ Then the bathrooms committee should be exactly "<total>"
9
10
  Examples:
10
- | full_baths | half_baths | bathrooms |
11
- | 2 | 0.5 | 2.5 |
11
+ | full_baths | half_baths | total |
12
+ | 1 | 0 | 1.0 |
13
+ | 2 | 1 | 2.5 |
14
+ | 3 | 2 | 4.0 |
12
15
 
13
- Scenario Outline: Predicted annual electricity use committee
14
- Given a residence has "lighting_efficiency" of "<lighting_efficiency>"
15
- When emissions are calculated
16
- Then the predicted_annual_electricity_use committee should be exactly <predicted_annual_electricity_use>
16
+ Scenario Outline: Predicted annual electricity use committee from cohort
17
+ Given a residence emitter
18
+ And a characteristic "bedrooms" of "<bedrooms>"
19
+ And a characteristic "lighting_efficiency" of "<lighting_efficiency>"
20
+ When the "cohort" committee is calculated
21
+ And the "predicted_annual_electricity_use" committee is calculated
22
+ Then the conclusion of the committee should be "<prediction>"
17
23
  Examples:
18
- | lighting_efficiency | predicted_annual_electricity_use |
19
- | 0.5 | 14409.3456880943 |
24
+ | bedrooms | lighting_efficiency | prediction |
25
+ | 3 | 0.5 | 12393.36822 |
26
+
27
+ Scenario: Predicted annual electricity use committee from default
28
+ Given a residence emitter
29
+ And a characteristic "lighting_efficiency" of "0.5"
30
+ When the "predicted_annual_electricity_use" committee is calculated
31
+ Then the conclusion of the committee should be "10752.83"
@@ -8,7 +8,7 @@ Feature: Residence Emissions Calculations
8
8
  And it has "urbanity.name" of "<urbanity>"
9
9
  And it has "dishwasher_use.name" of "<dishwasher_use>"
10
10
  When emissions are calculated
11
- Then the emission value should be within 0.1 kgs of <emission>
11
+ Then the emission value should be within "0.1" kgs of "<emission>"
12
12
  Examples:
13
- | zip_code | floorspace | residence_class | urbanity | dishwasher_use | emission |
14
- | 48915 | 1400 | Single-family detached house (a one-family house detached from any other house) | City | 4 to 6 times a week | 6068.6 |
13
+ | zip_code | floorspace | residence_class | urbanity | dishwasher_use | emission |
14
+ | 48915 | 1400 | Single-family detached house (a one-family house detached from any other house) | City | 4 to 6 times a week | 6091.88178 |
@@ -5,4 +5,4 @@ require 'cucumber'
5
5
  require 'cucumber/formatter/unicode'
6
6
 
7
7
  require 'sniff'
8
- Sniff.init File.join(File.dirname(__FILE__), '..', '..'), :earth => [:residence, :locality], :cucumber => true
8
+ Sniff.init File.expand_path('../..', File.dirname(__FILE__)), :earth => [:residence, :locality], :cucumber => true
@@ -1,12 +1,9 @@
1
1
  # sabshere 8/15/10 should these just be required in the emitter gem's lib/emitter.rb?
2
- require 'leap'
3
- require 'weighted_average'
4
2
 
5
3
  module BrighterPlanet
6
4
  module Residence
7
5
  module CarbonModel
8
6
  def self.included(base)
9
- base.extend ::Leap::Subject
10
7
  base.decide :emission, :with => :characteristics do
11
8
  committee :emission do
12
9
  quorum 'from fuel and electricity use and occupation and residents', :needs => [:fuel_oil_consumed, :natural_gas_consumed, :dirty_electricity_generated, :propane_consumed, :biomass_consumed, :kerosene_consumed, :coal_consumed, :residents, :electricity_emission_factor, :floorspace_estimate, :air_conditioner_use, :active_subtimeframe, :occupation] do |characteristics, timeframe|
@@ -1,11 +1,8 @@
1
1
  # sabshere 8/15/10 should this just be required in the emitter gem's lib/emitter.rb?
2
- require 'characterizable'
3
-
4
2
  module BrighterPlanet
5
3
  module Residence
6
4
  module Characterization
7
5
  def self.included(base)
8
- base.send :include, Characterizable
9
6
  base.characterize do
10
7
  has :zip_code
11
8
  has :urbanity
@@ -43,7 +40,6 @@ module BrighterPlanet
43
40
  has :annual_coal_volume_estimate, :trumps => :annual_coal_cost, :measures => :mass # it says volume, but it wants mass
44
41
  # has :annual_coal_cost, :trumps => :annual_coal_volume_estimate, :measures => :cost
45
42
  end
46
- base.add_implicit_characteristics
47
43
  end
48
44
  end
49
45
  end
@@ -1,7 +1,5 @@
1
1
  # sabshere 8/15/10 should this just be required in the emitter gem's lib/emitter.rb?
2
2
  # (i can see why not... you might not always want data_miner)
3
- require 'data_miner'
4
-
5
3
  module BrighterPlanet
6
4
  module Residence
7
5
  module Data
@@ -1,11 +1,8 @@
1
1
  # sabshere 8/15/10 should this just be required in the emitter gem's lib/emitter.rb?
2
- require 'summary_judgement'
3
-
4
2
  module BrighterPlanet
5
3
  module Residence
6
4
  module Summarization
7
5
  def self.included(base)
8
- base.extend SummaryJudgement
9
6
  base.summarize do |has|
10
7
  has.adjective lambda { |residence| "#{residence.rooms}-room" }, :if => :rooms
11
8
  has.identity [:residence_class, :name], :if => :residence_class
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: residence
3
3
  version: !ruby/object:Gem::Version
4
- hash: 3
4
+ hash: 1
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 14
10
- version: 0.0.14
9
+ - 15
10
+ version: 0.0.15
11
11
  platform: ruby
12
12
  authors:
13
13
  - Andy Rossmeissl
@@ -19,48 +19,46 @@ autorequire:
19
19
  bindir: bin
20
20
  cert_chain: []
21
21
 
22
- date: 2010-09-08 00:00:00 -05:00
22
+ date: 2010-09-22 00:00:00 -04:00
23
23
  default_executable:
24
24
  dependencies:
25
25
  - !ruby/object:Gem::Dependency
26
- name: activerecord
26
+ type: :development
27
27
  prerelease: false
28
- requirement: &id001 !ruby/object:Gem::Requirement
28
+ name: activerecord
29
+ version_requirements: &id001 !ruby/object:Gem::Requirement
29
30
  none: false
30
31
  requirements:
31
- - - ">="
32
+ - - ~>
32
33
  - !ruby/object:Gem::Version
33
- hash: 299253624
34
+ hash: 7
34
35
  segments:
35
36
  - 3
36
37
  - 0
37
38
  - 0
38
- - beta4
39
- version: 3.0.0.beta4
40
- type: :development
41
- version_requirements: *id001
39
+ version: 3.0.0
40
+ requirement: *id001
42
41
  - !ruby/object:Gem::Dependency
43
- name: bundler
42
+ type: :development
44
43
  prerelease: false
45
- requirement: &id002 !ruby/object:Gem::Requirement
44
+ name: bundler
45
+ version_requirements: &id002 !ruby/object:Gem::Requirement
46
46
  none: false
47
47
  requirements:
48
- - - ">="
48
+ - - ~>
49
49
  - !ruby/object:Gem::Version
50
- hash: 62196359
50
+ hash: 23
51
51
  segments:
52
52
  - 1
53
53
  - 0
54
54
  - 0
55
- - beta
56
- - 2
57
- version: 1.0.0.beta.2
58
- type: :development
59
- version_requirements: *id002
55
+ version: 1.0.0
56
+ requirement: *id002
60
57
  - !ruby/object:Gem::Dependency
61
- name: cucumber
58
+ type: :development
62
59
  prerelease: false
63
- requirement: &id003 !ruby/object:Gem::Requirement
60
+ name: cucumber
61
+ version_requirements: &id003 !ruby/object:Gem::Requirement
64
62
  none: false
65
63
  requirements:
66
64
  - - ">="
@@ -71,12 +69,12 @@ dependencies:
71
69
  - 8
72
70
  - 3
73
71
  version: 0.8.3
74
- type: :development
75
- version_requirements: *id003
72
+ requirement: *id003
76
73
  - !ruby/object:Gem::Dependency
77
- name: jeweler
74
+ type: :development
78
75
  prerelease: false
79
- requirement: &id004 !ruby/object:Gem::Requirement
76
+ name: jeweler
77
+ version_requirements: &id004 !ruby/object:Gem::Requirement
80
78
  none: false
81
79
  requirements:
82
80
  - - ">="
@@ -87,12 +85,12 @@ dependencies:
87
85
  - 4
88
86
  - 0
89
87
  version: 1.4.0
90
- type: :development
91
- version_requirements: *id004
88
+ requirement: *id004
92
89
  - !ruby/object:Gem::Dependency
93
- name: rake
90
+ type: :development
94
91
  prerelease: false
95
- requirement: &id005 !ruby/object:Gem::Requirement
92
+ name: rake
93
+ version_requirements: &id005 !ruby/object:Gem::Requirement
96
94
  none: false
97
95
  requirements:
98
96
  - - ">="
@@ -101,12 +99,12 @@ dependencies:
101
99
  segments:
102
100
  - 0
103
101
  version: "0"
104
- type: :development
105
- version_requirements: *id005
102
+ requirement: *id005
106
103
  - !ruby/object:Gem::Dependency
107
- name: rdoc
104
+ type: :development
108
105
  prerelease: false
109
- requirement: &id006 !ruby/object:Gem::Requirement
106
+ name: rdoc
107
+ version_requirements: &id006 !ruby/object:Gem::Requirement
110
108
  none: false
111
109
  requirements:
112
110
  - - ">="
@@ -115,15 +113,15 @@ dependencies:
115
113
  segments:
116
114
  - 0
117
115
  version: "0"
118
- type: :development
119
- version_requirements: *id006
116
+ requirement: *id006
120
117
  - !ruby/object:Gem::Dependency
121
- name: rspec
118
+ type: :development
122
119
  prerelease: false
123
- requirement: &id007 !ruby/object:Gem::Requirement
120
+ name: rspec
121
+ version_requirements: &id007 !ruby/object:Gem::Requirement
124
122
  none: false
125
123
  requirements:
126
- - - ">="
124
+ - - ~>
127
125
  - !ruby/object:Gem::Version
128
126
  hash: 62196417
129
127
  segments:
@@ -133,40 +131,39 @@ dependencies:
133
131
  - beta
134
132
  - 17
135
133
  version: 2.0.0.beta.17
136
- type: :development
137
- version_requirements: *id007
134
+ requirement: *id007
138
135
  - !ruby/object:Gem::Dependency
139
- name: sniff
136
+ type: :development
140
137
  prerelease: false
141
- requirement: &id008 !ruby/object:Gem::Requirement
138
+ name: sniff
139
+ version_requirements: &id008 !ruby/object:Gem::Requirement
142
140
  none: false
143
141
  requirements:
144
- - - ">="
142
+ - - ~>
145
143
  - !ruby/object:Gem::Version
146
- hash: 1
144
+ hash: 3
147
145
  segments:
148
146
  - 0
149
- - 0
150
- - 15
151
- version: 0.0.15
152
- type: :development
153
- version_requirements: *id008
147
+ - 1
148
+ - 12
149
+ version: 0.1.12
150
+ requirement: *id008
154
151
  - !ruby/object:Gem::Dependency
155
- name: emitter
152
+ type: :runtime
156
153
  prerelease: false
157
- requirement: &id009 !ruby/object:Gem::Requirement
154
+ name: emitter
155
+ version_requirements: &id009 !ruby/object:Gem::Requirement
158
156
  none: false
159
157
  requirements:
160
- - - ">="
158
+ - - ~>
161
159
  - !ruby/object:Gem::Version
162
- hash: 15
160
+ hash: 19
163
161
  segments:
164
162
  - 0
165
- - 0
166
- - 8
167
- version: 0.0.8
168
- type: :runtime
169
- version_requirements: *id009
163
+ - 1
164
+ - 4
165
+ version: 0.1.4
166
+ requirement: *id009
170
167
  description: A software model in Ruby for the greenhouse gas emissions of an residence
171
168
  email: andy@rossmeissl.net
172
169
  executables: []