Sha256: dbdd3ddf15b58d452aa7696a6f55b21b157629ef2ab30fee6d32f6a5ac36d12a

Contents?: true

Size: 990 Bytes

Versions: 12

Compression:

Stored size: 990 Bytes

Contents

require 'cohort_analysis'
ClothesMachineUse.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 => ClothesMachineUse,
        :cols => { :clothes_washer_use => :name }
      )
    end
    
    # sabshere 5/20/10 weird that this uses cohort
    process "precalculate annual energy use" do
      find_each do |record|
        record.annual_energy_from_electricity_for_clothes_driers = ResidentialEnergyConsumptionSurveyResponse.cohort(:clothes_machine_use_id => record.name).weighted_average :annual_energy_from_electricity_for_clothes_driers
        record.annual_energy_from_electricity_for_clothes_driers_units = 'joules'
        record.save!
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
earth-0.12.3 lib/earth/residence/clothes_machine_use/data_miner.rb
earth-0.12.2 lib/earth/residence/clothes_machine_use/data_miner.rb
earth-0.12.1 lib/earth/residence/clothes_machine_use/data_miner.rb
earth-0.12.0 lib/earth/residence/clothes_machine_use/data_miner.rb
earth-0.11.20 lib/earth/residence/clothes_machine_use/data_miner.rb
earth-0.11.19 lib/earth/residence/clothes_machine_use/data_miner.rb
earth-0.11.18 lib/earth/residence/clothes_machine_use/data_miner.rb
earth-0.11.17 lib/earth/residence/clothes_machine_use/data_miner.rb
earth-0.11.16 lib/earth/residence/clothes_machine_use/data_miner.rb
earth-0.11.15 lib/earth/residence/clothes_machine_use/data_miner.rb
earth-0.11.14 lib/earth/residence/clothes_machine_use/data_miner.rb
earth-0.11.13 lib/earth/residence/clothes_machine_use/data_miner.rb