Permalink
Browse files

make tests green (except one about big_cohort) with new sniff

  • Loading branch information...
1 parent 951d583 commit e8e5ddef76633583698fdf65fd0e3012058fd1f5 @seamusabshere seamusabshere committed Jun 9, 2011
View
1 .gitignore
@@ -19,3 +19,4 @@ rdoc
pkg
## PROJECT::SPECIFIC
+Gemfile.lock
View
7 Gemfile
@@ -1,7 +1,8 @@
-gem 'earth', :path => ENV['LOCAL_EARTH'] if ENV['LOCAL_EARTH']
-gem 'falls_back_on', :path => ENV['LOCAL_FALLS_BACK_ON'] if ENV['LOCAL_FALLS_BACK_ON']
+gem 'emitter', :path => ENV['LOCAL_EMITTER'] if ENV['LOCAL_EMITTER']
gem 'sniff', :path => ENV['LOCAL_SNIFF'] if ENV['LOCAL_SNIFF']
-
+gem 'earth', :path => ENV['LOCAL_EARTH'] if ENV['LOCAL_EARTH']
+gem 'data_miner', :path => ENV['LOCAL_DATA_MINER'] if ENV['LOCAL_DATA_MINER']
+gem 'create_table', :path => ENV['LOCAL_CREATE_TABLE'] if ENV['LOCAL_CREATE_TABLE']
source :rubygems
gemspec :path => '.'
View
0 ...port/db/fixtures/air_conditioner_uses.csv → ...port/db/fixtures/air_conditioner_uses.csv
File renamed without changes.
View
0 ...port/db/fixtures/clothes_machine_uses.csv → ...port/db/fixtures/clothes_machine_uses.csv
File renamed without changes.
View
0 ...t_support/db/fixtures/dishwasher_uses.csv → ...s/support/db/fixtures/dishwasher_uses.csv
File renamed without changes.
View
0 ...st_support/db/fixtures/recs_responses.csv → ...es/support/db/fixtures/recs_responses.csv
File renamed without changes.
View
0 ...support/db/fixtures/residence_classes.csv → ...support/db/fixtures/residence_classes.csv
File renamed without changes.
View
0 ...ort/db/fixtures/residence_fuel_prices.csv → ...ort/db/fixtures/residence_fuel_prices.csv
File renamed without changes.
View
0 ...port/db/fixtures/residence_fuel_types.csv → ...port/db/fixtures/residence_fuel_types.csv
File renamed without changes.
View
0 lib/test_support/residence_record.rb → features/support/residence_record.rb
File renamed without changes.
View
36 lib/residence/characterization.rb
@@ -14,31 +14,31 @@ def self.included(base)
has :air_conditioner_use
has :refrigerator_count
has :freezer_count
- has :lighting_efficiency, :measures => :percentage
- has :floorspace_estimate, :trumps => :rooms, :measures => :area
+ has :lighting_efficiency#, :measures => :percentage
+ has :floorspace_estimate
has :floors # not used
has :bathrooms
has :bedrooms
- has :full_bathrooms, :hidden => true
- has :half_bathrooms, :hidden => true
- has :rooms, :trumps => [:bathrooms, :bedrooms, :full_bathrooms, :half_bathrooms]
+ has :full_bathrooms
+ has :half_bathrooms
+ has :rooms
has :acquisition
has :retirement
has :construction_year # TODO show year only
- has :occupation, :measures => :percentage
- has :annual_fuel_oil_volume_estimate, :trumps => :annual_fuel_oil_cost, :measures => :volume
- has :annual_fuel_oil_cost, :trumps => :annual_fuel_oil_volume_estimate, :measures => :cost
- has :monthly_natural_gas_volume_estimate, :trumps => :monthly_natural_gas_cost, :measurement_options => { :external => :therms, :internal => :joules }
- has :monthly_natural_gas_cost, :trumps => :monthly_natural_gas_volume_estimate, :measures => :cost
- has :monthly_electricity_use_estimate, :trumps => :monthly_electricity_cost, :measures => :electrical_energy
- has :monthly_electricity_cost, :trumps => :monthly_electricity_use_estimate, :measures => :cost
- has :green_electricity, :measures => :percentage
- has :annual_propane_volume_estimate, :trumps => :annual_propane_cost, :measures => :volume
- has :annual_propane_cost, :trumps => :annual_propane_volume_estimate, :measures => :cost
+ has :occupation#, :measures => :percentage
+ has :annual_fuel_oil_volume_estimate, :measures => :volume
+ has :annual_fuel_oil_cost, :measures => :cost
+ has :monthly_natural_gas_volume_estimate #:measurement_options => { :external => :therms, :internal => :joules }
+ has :monthly_natural_gas_cost, :measures => :cost
+ has :monthly_electricity_use_estimate, :measures => :electrical_energy
+ has :monthly_electricity_cost, :measures => :cost
+ has :green_electricity#, :measures => :percentage
+ has :annual_propane_volume_estimate, :measures => :volume
+ has :annual_propane_cost, :measures => :cost
has :annual_wood_volume_estimate, :measures => :biomass
- has :annual_kerosene_volume_estimate, :trumps => :annual_kerosene_cost, :measures => :volume
- has :annual_coal_volume_estimate, :trumps => :annual_coal_cost, :measures => :mass # it says volume, but it wants mass
- # has :annual_coal_cost, :trumps => :annual_coal_volume_estimate, :measures => :cost
+ has :annual_kerosene_volume_estimate, :measures => :volume
+ has :annual_coal_volume_estimate, :measures => :mass # it says volume, but it wants mass
+ # has :annual_coal_cost, :measures => :cost
end
end
end
View
86 lib/residence/data.rb
@@ -4,56 +4,54 @@ module BrighterPlanet
module Residence
module Data
def self.included(base)
+ base.create_table do
+ string 'residence_class_id'
+ string 'urbanity_id'
+ string 'zip_code_id'
+ date 'construction_year'
+ boolean 'ownership'
+ float 'occupation'
+ integer 'residents'
+ integer 'floors'
+ float 'floorspace_estimate'
+ string 'air_conditioner_use_id'
+ string 'dishwasher_use_id'
+ string 'clothes_machine_use_id'
+ integer 'refrigerator_count'
+ integer 'freezer_count'
+ float 'lighting_efficiency'
+ integer 'bedrooms'
+ integer 'dining_rooms'
+ integer 'living_rooms'
+ integer 'kitchens'
+ integer 'full_bathrooms'
+ integer 'half_bathrooms'
+ float 'bathrooms'
+ integer 'other_rooms'
+ integer 'heated_garage_berths'
+ float 'annual_fuel_oil_volume_estimate'
+ float 'annual_fuel_oil_cost'
+ float 'monthly_natural_gas_volume_estimate'
+ float 'monthly_natural_gas_cost'
+ float 'monthly_electricity_use_estimate'
+ float 'monthly_electricity_cost'
+ float 'green_electricity'
+ float 'annual_propane_volume_estimate'
+ float 'annual_propane_cost'
+ float 'annual_wood_volume_estimate'
+ float 'annual_kerosene_volume_estimate'
+ float 'annual_coal_volume_estimate'
+ float 'annual_coal_cost'
+ date 'acquisition'
+ date 'retirement'
+ end
+
base.data_miner do
- schema do
- string 'residence_class_id'
- string 'urbanity_id'
- string 'zip_code_id'
- date 'construction_year'
- boolean 'ownership'
- float 'occupation'
- integer 'residents'
- integer 'floors'
- float 'floorspace_estimate'
- string 'air_conditioner_use_id'
- string 'dishwasher_use_id'
- string 'clothes_machine_use_id'
- integer 'refrigerator_count'
- integer 'freezer_count'
- float 'lighting_efficiency'
- integer 'bedrooms'
- integer 'dining_rooms'
- integer 'living_rooms'
- integer 'kitchens'
- integer 'full_bathrooms'
- integer 'half_bathrooms'
- float 'bathrooms'
- integer 'other_rooms'
- integer 'heated_garage_berths'
- float 'annual_fuel_oil_volume_estimate'
- float 'annual_fuel_oil_cost'
- float 'monthly_natural_gas_volume_estimate'
- float 'monthly_natural_gas_cost'
- float 'monthly_electricity_use_estimate'
- float 'monthly_electricity_cost'
- float 'green_electricity'
- float 'annual_propane_volume_estimate'
- float 'annual_propane_cost'
- float 'annual_wood_volume_estimate'
- float 'annual_kerosene_volume_estimate'
- float 'annual_coal_volume_estimate'
- float 'annual_coal_cost'
- date 'acquisition'
- date 'retirement'
- end
-
process "pull orphans" do
ResidenceFuelType.run_data_miner!
ResidenceFuelPrice.run_data_miner!
ResidentialEnergyConsumptionSurveyResponse.run_data_miner!
end
-
- process :run_data_miner_on_belongs_to_associations
end
end
end
View
5 residence.gemspec
@@ -22,7 +22,6 @@ Gem::Specification.new do |s|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ["lib"]
- s.add_runtime_dependency 'emitter'
- s.add_development_dependency 'sniff'
+ s.add_runtime_dependency 'emitter' unless ENV['LOCAL_EMITTER']
+ s.add_development_dependency 'sniff' unless ENV['LOCAL_SNIFF']
end
-

0 comments on commit e8e5dde

Please sign in to comment.