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