Sha256: 7e7d9b2a98c16ad151433a43489c6f6ec2123bde98ea42ab746232d131b3a545

Contents?: true

Size: 941 Bytes

Versions: 13

Compression:

Stored size: 941 Bytes

Contents

DishwasherUse.class_eval do
  data_miner do
    process "Ensure ResidentialEnergyConsumptionSurveyResponse is populated" do
      ResidentialEnergyConsumptionSurveyResponse.run_data_miner!
    end
    
    process "Derive from ResidentialEnergyConsumptionSurveyResponse" do
      ::Earth::Utils.insert_ignore(
        :src => ResidentialEnergyConsumptionSurveyResponse,
        :dest => DishwasherUse,
        :cols => { :dishwasher_use_id => :name }
      )
    end
    
    # sabshere 5/25/10 weird that this uses cohort
    process "precalculate annual energy" do
      find_each do |record|
        record.annual_energy_from_electricity_for_dishwashers = ResidentialEnergyConsumptionSurveyResponse.big_cohort(:dishwasher_use_id => record.name).weighted_average :annual_energy_from_electricity_for_dishwashers
        record.annual_energy_from_electricity_for_dishwashers_units = 'joules'
        record.save!
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
earth-0.11.12 lib/earth/residence/dishwasher_use/data_miner.rb
earth-0.11.11 lib/earth/residence/dishwasher_use/data_miner.rb
earth-0.11.10 lib/earth/residence/dishwasher_use/data_miner.rb
earth-0.11.9 lib/earth/residence/dishwasher_use/data_miner.rb
earth-0.11.8 lib/earth/residence/dishwasher_use/data_miner.rb
earth-0.11.7 lib/earth/residence/dishwasher_use/data_miner.rb
earth-0.11.6 lib/earth/residence/dishwasher_use/data_miner.rb
earth-0.11.5 lib/earth/residence/dishwasher_use/data_miner.rb
earth-0.11.4 lib/earth/residence/dishwasher_use/data_miner.rb
earth-0.11.3 lib/earth/residence/dishwasher_use/data_miner.rb
earth-0.11.2 lib/earth/residence/dishwasher_use/data_miner.rb
earth-0.11.1 lib/earth/residence/dishwasher_use/data_miner.rb
earth-0.11.0 lib/earth/residence/dishwasher_use/data_miner.rb