Sha256: 0a42146309da2bc0dc313ea4c67d5327a5373d169fefab3a27893dafa6b15a21

Contents?: true

Size: 965 Bytes

Versions: 7

Compression:

Stored size: 965 Bytes

Contents

require 'earth/locality/data_miner'

ElectricMarket.class_eval do
  data_miner do
    import 'IOU markets',
           :url => 'http://en.openei.org/datasets/files/899/pub/iou_zipcodes.csv',
           :errata => { :url => "file://#{Earth::ERRATA_DIR}/electricity/electric_market/nrel_errata.csv" } do
      key 'id', :synthesize => proc { |row| row['compid'].to_i.to_s + '-' + row['zip'] }
      store 'zip_code_name', :field_name => 'zip'
      store 'electric_utility_eia_id', :field_name => 'compid'
    end
    
    import 'Non-IOU markets',
           :url => 'http://en.openei.org/datasets/files/899/pub/non-iou_zipcodes.csv',
           :errata => { :url => "file://#{Earth::ERRATA_DIR}/electricity/electric_market/nrel_errata.csv" } do
      key 'id', :synthesize => proc { |row| row['compid'].to_i.to_s + '-' + row['zip'] }
      store 'zip_code_name', :field_name => 'zip'
      store 'electric_utility_eia_id', :field_name => 'compid'
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
earth-0.12.4 lib/earth/electricity/electric_market/data_miner.rb
earth-0.12.3 lib/earth/electricity/electric_market/data_miner.rb
earth-0.12.2 lib/earth/electricity/electric_market/data_miner.rb
earth-0.12.1 lib/earth/electricity/electric_market/data_miner.rb
earth-0.12.0 lib/earth/electricity/electric_market/data_miner.rb
earth-0.11.20 lib/earth/electricity/electric_market/data_miner.rb
earth-0.11.19 lib/earth/electricity/electric_market/data_miner.rb