Sha256: 2da5fdf2a8eb48e536f3c244642829c95d3673dece6418ed91dd929ebf57b96b

Contents?: true

Size: 940 Bytes

Versions: 29

Compression:

Stored size: 940 Bytes

Contents

AirConditionerUse.class_eval do
  data_miner do
    schema do
      string 'name'
      float 'fugitive_emission'
      string 'fugitive_emission_units'
    end

    process "derive from ResidentialEnergyConsumptionSurveyResponse" do
      ResidentialEnergyConsumptionSurveyResponse.run_data_miner!
      connection.execute %{
        INSERT IGNORE INTO air_conditioner_uses(name)
        SELECT DISTINCT residential_energy_consumption_survey_responses.central_ac_use FROM residential_energy_consumption_survey_responses WHERE LENGTH(residential_energy_consumption_survey_responses.central_ac_use) > 0
      }
    end
    
    import "Ian's precalculated fugitive emissions values", :url => 'http://spreadsheets.google.com/pub?key=ri_380yQZAqBKeqie_TECgg' do
      key 'name', :field_name => 'air_conditioner_use_name'
      store 'fugitive_emission', :units_field_name => 'unit', :to_units => :kilograms_per_square_metre
    end
  end
end

Version data entries

29 entries across 29 versions & 2 rubygems

Version Path
earth-0.3.11 lib/earth/residence/air_conditioner_use/data_miner.rb
earth-0.3.10 lib/earth/residence/air_conditioner_use/data_miner.rb
earth-0.3.9 lib/earth/residence/air_conditioner_use/data_miner.rb
earth-0.3.8 lib/earth/residence/air_conditioner_use/data_miner.rb
earth-0.3.7 lib/earth/residence/air_conditioner_use/data_miner.rb
earth-0.3.6 lib/earth/residence/air_conditioner_use/data_miner.rb
earth-0.3.5 lib/earth/residence/air_conditioner_use/data_miner.rb
earth-0.3.4 lib/earth/residence/air_conditioner_use/data_miner.rb
earth-0.3.3 lib/earth/residence/air_conditioner_use/data_miner.rb
earth-0.3.2 lib/earth/residence/air_conditioner_use/data_miner.rb
earth-0.3.1 lib/earth/residence/air_conditioner_use/data_miner.rb
earth-0.3.0 lib/earth/residence/air_conditioner_use/data_miner.rb
earth-0.2.14 lib/earth/residence/air_conditioner_use/data_miner.rb
earth-0.2.13 lib/earth/residence/air_conditioner_use/data_miner.rb
earth-0.2.12 lib/earth/residence/air_conditioner_use/data_miner.rb
earth-0.2.11 lib/earth/residence/air_conditioner_use/data_miner.rb
earth-0.2.9 lib/earth/residence/air_conditioner_use/data_miner.rb
earth-0.2.8 lib/earth/residence/air_conditioner_use/data_miner.rb
earth-0.2.7 lib/earth/residence/air_conditioner_use/data_miner.rb
earth-0.2.6 lib/earth/residence/air_conditioner_use/data_miner.rb