earth 0.11.16 → 0.11.17
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +15 -0
- data/Gemfile +2 -2
- data/bin/earth_tester.rb +3 -1
- data/earth.gemspec +4 -8
- data/errata/aircraft/faa_errata.csv +375 -0
- data/errata/airport/openflights_errata.csv +1 -0
- data/errata/automobile_make_model_year_variant/feg_errata.csv +283 -0
- data/errata/automobile_make_year_fleet/cafe_errata.csv +1 -0
- data/errata/bts_aircraft/bts_errata.csv +68 -0
- data/errata/country/wri_errata.csv +25 -0
- data/errata/flight_segment/bts_errata.csv +1 -0
- data/errata/readme +3 -0
- data/features/step_definitions/data_steps.rb +1 -1
- data/lib/earth.rb +40 -75
- data/lib/earth/air/aircraft.rb +3 -1
- data/lib/earth/air/aircraft/data_miner.rb +2 -2
- data/lib/earth/air/airport.rb +1 -1
- data/lib/earth/air/airport/data_miner.rb +12 -32
- data/lib/earth/air/bts_aircraft/data_miner.rb +1 -1
- data/lib/earth/air/flight_segment/data_miner.rb +6 -7
- data/lib/earth/automobile/automobile_make_model_year/data_miner.rb +1 -1
- data/lib/earth/automobile/automobile_make_model_year_variant/data_miner.rb +21 -42
- data/lib/earth/automobile/automobile_make_year_fleet/data_miner.rb +4 -4
- data/lib/earth/automobile/automobile_type_fuel_year/data_miner.rb +8 -8
- data/lib/earth/automobile/automobile_type_fuel_year_age/data_miner.rb +24 -24
- data/lib/earth/fuel/fuel/data_miner.rb +2 -2
- data/lib/earth/fuel/fuel_price/data_miner.rb +1 -1
- data/lib/earth/industry/cbecs_energy_intensity/data_miner.rb +1 -1
- data/lib/earth/industry/naics_2002_naics_2007_concordance/data_miner.rb +3 -3
- data/lib/earth/industry/naics_2002_sic_1987_concordance/data_miner.rb +4 -4
- data/lib/earth/industry/sic_1987/data_miner.rb +3 -3
- data/lib/earth/locality/census_region/data_miner.rb +1 -1
- data/lib/earth/locality/country/data_miner.rb +2 -2
- data/lib/earth/locality/egrid_region/data_miner.rb +1 -1
- data/lib/earth/locality/egrid_subregion/data_miner.rb +1 -1
- data/lib/earth/locality/state/data_miner.rb +2 -2
- data/lib/earth/locality/zip_code.rb +1 -1
- data/lib/earth/pet/breed/data_miner.rb +1 -1
- data/lib/earth/pet/breed_gender/data_miner.rb +2 -2
- data/lib/earth/pet/gender/data_miner.rb +1 -1
- data/lib/earth/rail/country_rail_class/data_miner.rb +1 -1
- data/lib/earth/rail/country_rail_traction/data_miner.rb +1 -1
- data/lib/earth/rail/country_rail_traction_class/data_miner.rb +1 -1
- data/lib/earth/rail/national_transit_database_record/data_miner.rb +3 -3
- data/lib/earth/residence/residence_fuel_price/data_miner.rb +5 -5
- data/lib/earth/residence/residential_energy_consumption_survey_response/data_miner.rb +9 -9
- data/lib/earth/version.rb +1 -1
- data/spec/earth/air/aircraft_spec.rb +11 -5
- data/spec/earth/air/airport_spec.rb +40 -0
- data/spec/earth/air/bts_aircraft_spec.rb +19 -0
- data/spec/earth/air/flight_segment_spec.rb +49 -0
- data/spec/earth/automobile/automobile_make_model_year_variant_spec.rb +55 -0
- data/spec/earth/automobile/automobile_make_year_fleet_spec.rb +37 -0
- data/spec/earth/locality/country_spec.rb +4 -0
- metadata +198 -172
- data/features/automobile_make_fleet_year.feature +0 -34
- data/features/automobile_make_model_year_variant.feature +0 -46
- data/features/support/imports/automobile_fuel_bad.csv +0 -3
- data/features/support/imports/automobile_fuel_good.csv +0 -3
- data/features/support/imports/automobile_make_bad.csv +0 -3
- data/features/support/imports/automobile_make_fleet_year_bad.csv +0 -2
- data/features/support/imports/automobile_make_fleet_year_good.csv +0 -2
- data/features/support/imports/automobile_make_good.csv +0 -3
- data/features/support/imports/automobile_make_model_bad.csv +0 -3
- data/features/support/imports/automobile_make_model_good.csv +0 -3
- data/features/support/imports/automobile_make_model_year_bad.csv +0 -3
- data/features/support/imports/automobile_make_model_year_good.csv +0 -3
- data/features/support/imports/automobile_make_model_year_variant_bad.csv +0 -3
- data/features/support/imports/automobile_make_model_year_variant_good.csv +0 -3
- data/features/support/imports/automobile_make_year_bad.csv +0 -3
- data/features/support/imports/automobile_make_year_good.csv +0 -3
- data/features/support/imports/automobile_size_class_bad.csv +0 -3
- data/features/support/imports/automobile_size_class_good.csv +0 -3
- data/features/support/imports/automobile_size_class_year_bad.csv +0 -2
- data/features/support/imports/automobile_size_class_year_good.csv +0 -2
- data/features/support/imports/automobile_type_fuel_age_bad.csv +0 -3
- data/features/support/imports/automobile_type_fuel_age_good.csv +0 -3
- data/features/support/imports/automobile_type_fuel_control_bad.csv +0 -3
- data/features/support/imports/automobile_type_fuel_control_good.csv +0 -3
- data/features/support/imports/automobile_type_fuel_year_age_bad.csv +0 -2
- data/features/support/imports/automobile_type_fuel_year_age_good.csv +0 -2
- data/features/support/imports/automobile_type_fuel_year_bad.csv +0 -2
- data/features/support/imports/automobile_type_fuel_year_control_bad.csv +0 -2
- data/features/support/imports/automobile_type_fuel_year_control_good.csv +0 -2
- data/features/support/imports/automobile_type_fuel_year_good.csv +0 -2
- data/features/support/imports/automobile_type_year_bad.csv +0 -2
- data/features/support/imports/automobile_type_year_good.csv +0 -2
- data/features/support/imports/bus_class_bad.csv +0 -2
- data/features/support/imports/bus_class_good.csv +0 -2
- data/features/support/imports/bus_fuel_bad.csv +0 -3
- data/features/support/imports/bus_fuel_good.csv +0 -3
- data/features/support/imports/carrier_bad.csv +0 -3
- data/features/support/imports/carrier_good.csv +0 -3
- data/features/support/imports/carrier_mode_bad.csv +0 -2
- data/features/support/imports/carrier_mode_good.csv +0 -2
- data/features/support/imports/computation_carrier_bad.csv +0 -3
- data/features/support/imports/computation_carrier_good.csv +0 -3
- data/features/support/imports/computation_carrier_instance_class_bad.csv +0 -2
- data/features/support/imports/computation_carrier_instance_class_good.csv +0 -2
- data/features/support/imports/egrid_region_bad.csv +0 -3
- data/features/support/imports/egrid_region_good.csv +0 -3
- data/features/support/imports/egrid_subregion_bad.csv +0 -2
- data/features/support/imports/egrid_subregion_good.csv +0 -2
- data/features/support/imports/fuel_year_bad.csv +0 -2
- data/features/support/imports/fuel_year_good.csv +0 -2
- data/features/support/imports/greenhouse_gas_bad.csv +0 -2
- data/features/support/imports/greenhouse_gas_good.csv +0 -2
- data/features/support/imports/rail_class_bad.csv +0 -3
- data/features/support/imports/rail_class_good.csv +0 -3
- data/features/support/imports/shipment_mode_bad.csv +0 -3
- data/features/support/imports/shipment_mode_good.csv +0 -3
- data/lib/earth/air/aircraft_instance.rb +0 -11
- data/lib/earth/air/aircraft_instance_seat_class.rb +0 -13
- data/lib/earth/hospitality/lodging_property.rb +0 -33
- data/vendor/clean_find_in_batches/init.rb +0 -35
@@ -1,34 +0,0 @@
|
|
1
|
-
# Feature: Data import for AutomobileMakeFleetYear
|
2
|
-
# As a data user
|
3
|
-
# I want to import MakeFleetYear data
|
4
|
-
# So that I can perform year-based calculations
|
5
|
-
#
|
6
|
-
# Scenario: Successfully verifying that year is from 1978 to 2010
|
7
|
-
# Given a "AutomobileMakeFleetYear" data import fetches results listed in "automobile_make_fleet_year_good"
|
8
|
-
# When a data import verifies "Year should be from 1978 to 2010"
|
9
|
-
# Then the verification should be successful
|
10
|
-
#
|
11
|
-
# Scenario: Successfully verifying that fuel efficiency and volume are greater than zero
|
12
|
-
# Given a "AutomobileMakeFleetYear" data import fetches results listed in "automobile_make_fleet_year_good"
|
13
|
-
# When a data import verifies "Fuel efficiency and volume should be greater than zero"
|
14
|
-
# Then the verification should be successful
|
15
|
-
#
|
16
|
-
# Scenario: Successfully verifying that fuel efficiency units are kilometres per litre
|
17
|
-
# Given a "AutomobileMakeFleetYear" data import fetches results listed in "automobile_make_fleet_year_good"
|
18
|
-
# When a data import verifies "Fuel efficiency units should be kilometres per litre"
|
19
|
-
# Then the verification should be successful
|
20
|
-
#
|
21
|
-
# Scenario: Failing to verify that year is from 1978 to 2010
|
22
|
-
# Given a "AutomobileMakeFleetYear" data import fetches results listed in "automobile_make_fleet_year_bad"
|
23
|
-
# When a data import verifies "Year should be from 1978 to 2010"
|
24
|
-
# Then the verification should not be successful
|
25
|
-
#
|
26
|
-
# Scenario: Failing to verify that fuel efficiency and volume are greater than zero
|
27
|
-
# Given a "AutomobileMakeFleetYear" data import fetches results listed in "automobile_make_fleet_year_bad"
|
28
|
-
# When a data import verifies "Fuel efficiency and volume should be greater than zero"
|
29
|
-
# Then the verification should not be successful
|
30
|
-
#
|
31
|
-
# Scenario: Failing to verify that fuel efficiency units are kilometres per litre
|
32
|
-
# Given a "AutomobileMakeFleetYear" data import fetches results listed in "automobile_make_fleet_year_bad"
|
33
|
-
# When a data import verifies "Fuel efficiency units should be kilometres per litre"
|
34
|
-
# Then the verification should not be successful
|
@@ -1,46 +0,0 @@
|
|
1
|
-
# Feature: Data import for AutomobileMakeModelYearVariant
|
2
|
-
# As a data user
|
3
|
-
# I want to import MakeModelYearVariant data
|
4
|
-
# So that I can perform variant-based calculations
|
5
|
-
#
|
6
|
-
# Scenario: Successfully verifying that year is from 1985 to 2011
|
7
|
-
# Given a "AutomobileMakeModelYearVariant" data import fetches results listed in "automobile_make_model_year_variant_good"
|
8
|
-
# When a data import verifies "Year should be from 1985 to 2011"
|
9
|
-
# Then the verification should be successful
|
10
|
-
#
|
11
|
-
# Scenario: Successfully verifying that fuel type code is found in AutomobileFuel
|
12
|
-
# Given a "AutomobileFuel" data import fetches results listed in "automobile_fuel_good"
|
13
|
-
# And a "AutomobileMakeModelYearVariant" data import fetches results listed in "automobile_make_model_year_variant_good"
|
14
|
-
# When a data import verifies "Fuel code should appear in AutomobileFuel"
|
15
|
-
# Then the verification should be successful
|
16
|
-
#
|
17
|
-
# Scenario: Successfully verifying that fuel efficiencies are greater than zero
|
18
|
-
# Given a "AutomobileMakeModelYearVariant" data import fetches results listed in "automobile_make_model_year_variant_good"
|
19
|
-
# When a data import verifies "Fuel efficiencies should be greater than zero"
|
20
|
-
# Then the verification should be successful
|
21
|
-
#
|
22
|
-
# Scenario: Successfully verifying that fuel efficiency units are kilometres per litre
|
23
|
-
# Given a "AutomobileMakeModelYearVariant" data import fetches results listed in "automobile_make_model_year_variant_good"
|
24
|
-
# When a data import verifies "Fuel efficiency units should be kilometres per litre"
|
25
|
-
# Then the verification should be successful
|
26
|
-
#
|
27
|
-
# Scenario: Failing to verify that year is from 1985 to 2011
|
28
|
-
# Given a "AutomobileMakeModelYearVariant" data import fetches results listed in "automobile_make_model_year_variant_bad"
|
29
|
-
# When a data import verifies "Year should be from 1985 to 2011"
|
30
|
-
# Then the verification should not be successful
|
31
|
-
#
|
32
|
-
# Scenario: Failing to verifying that fuel type code is found in AutomobileFuel
|
33
|
-
# Given a "AutomobileFuel" data import fetches results listed in "automobile_fuel_good"
|
34
|
-
# And a "AutomobileMakeModelYearVariant" data import fetches results listed in "automobile_make_model_year_variant_bad"
|
35
|
-
# When a data import verifies "Fuel code should appear in AutomobileFuel"
|
36
|
-
# Then the verification should not be successful
|
37
|
-
#
|
38
|
-
# Scenario: Failing to verify that fuel efficiencies are greater than zero
|
39
|
-
# Given a "AutomobileMakeModelYearVariant" data import fetches results listed in "automobile_make_model_year_variant_bad"
|
40
|
-
# When a data import verifies "Fuel efficiencies should be greater than zero"
|
41
|
-
# Then the verification should not be successful
|
42
|
-
#
|
43
|
-
# Scenario: Failing to verify that fuel efficiency units are kilometres per litre
|
44
|
-
# Given a "AutomobileMakeModelYearVariant" data import fetches results listed in "automobile_make_model_year_variant_bad"
|
45
|
-
# When a data import verifies "Fuel efficiency units should be kilometres per litre"
|
46
|
-
# Then the verification should not be successful
|
@@ -1,3 +0,0 @@
|
|
1
|
-
name,co2_emission_factor,co2_emission_factor_units,co2_biogenic_emission_factor,co2_biogenic_emission_factor_units,ch4_emission_factor,ch4_emission_factor_units,n2o_emission_factor,n2o_emission_factor_units,hfc_emission_factor,hfc_emission_factor_units,base_fuel_name,distance_key,ef_key,blend_portion
|
2
|
-
regular gasoline,-1,kilograms_per_gallon,-1,kilograms_per_gallon,0,kilograms_per_litre,0,kilograms_per_litre,0,kilograms_per_litre
|
3
|
-
b20,-1,kilograms_per_gallon,-1,kilograms_per_gallon,0,kilograms_per_litre,0,kilograms_per_litre,0,kilograms_per_litre,Distillate Fuel Oil No. 2,diesel,diesel,1.1
|
@@ -1,3 +0,0 @@
|
|
1
|
-
name,code,co2_emission_factor,co2_emission_factor_units,co2_biogenic_emission_factor,co2_biogenic_emission_factor_units,ch4_emission_factor,ch4_emission_factor_units,n2o_emission_factor,n2o_emission_factor_units,hfc_emission_factor,hfc_emission_factor_units,base_fuel_name,distance_key,ef_key,blend_portion
|
2
|
-
regular gasoline,R,1,kilograms_per_litre,0,kilograms_per_litre,0.1,kilograms_co2e_per_litre,0.1,kilograms_co2e_per_litre,0.1,kilograms_co2e_per_litre,Motor Gasoline,gasoline,gasoline
|
3
|
-
b20,BP-B20,0,kilograms_per_litre,1,kilograms_per_litre,0.1,kilograms_co2e_per_litre,0.1,kilograms_co2e_per_litre,0.1,kilograms_co2e_per_litre,Distillate Fuel Oil No. 2,diesel,diesel,0.2
|
@@ -1,3 +0,0 @@
|
|
1
|
-
row_hash,year,fuel_code,fuel_efficiency,fuel_efficiency_city,fuel_efficiency_highway,fuel_efficiency_units,fuel_efficiency_city_units,fuel_efficiency_highway_units
|
2
|
-
a1,2000,R,12.0,10.0,15.0,kilometres_per_litre,kilometres_per_litre,kilometres_per_litre
|
3
|
-
b2,2012,X,0,-10,0,foo,bar
|
@@ -1,3 +0,0 @@
|
|
1
|
-
row_hash,year,fuel_code,fuel_efficiency,fuel_efficiency_city,fuel_efficiency_highway,fuel_efficiency_units,fuel_efficiency_city_units,fuel_efficiency_highway_units
|
2
|
-
a1,2000,R,12.0,10.0,15.0,kilometres_per_litre,kilometres_per_litre,kilometres_per_litre
|
3
|
-
b2,2011,BP-B20,20.5,20.0,21.0,kilometres_per_litre,kilometres_per_litre,kilometres_per_litre
|
@@ -1,3 +0,0 @@
|
|
1
|
-
name,annual_distance,fuel_efficiency_city,fuel_efficiency_highway,hybrid_fuel_efficiency_city_multiplier,hybrid_fuel_efficiency_highway_multiplier,conventional_fuel_efficiency_city_multiplier,conventional_fuel_efficiency_highway_multiplier,annual_distance_units,fuel_efficiency_city_units,fuel_efficiency_highway_units
|
2
|
-
small,1000,10.0,15.0,1.1,1.2,0.9,0.95,kilometres,kilometres_per_litre,kilometres_per_litre
|
3
|
-
large,-100,-1,0,0,-1,0,-10
|
@@ -1,3 +0,0 @@
|
|
1
|
-
name,annual_distance,fuel_efficiency_city,fuel_efficiency_highway,annual_distance_units,fuel_efficiency_city_units,fuel_efficiency_highway_units,hybrid_fuel_efficiency_city_multiplier,hybrid_fuel_efficiency_highway_multiplier,conventional_fuel_efficiency_city_multiplier,conventional_fuel_efficiency_highway_multiplier
|
2
|
-
small,1000,10.0,15.0,kilometres,kilometres_per_litre,kilometres_per_litre,1.1,1.2,0.9,0.95
|
3
|
-
large,0.5,0.1,0.5,kilometres,kilometres_per_litre,kilometres_per_litre
|
@@ -1,3 +0,0 @@
|
|
1
|
-
name,age,age_percent,total_travel_percent,annual_distance,annual_distance_units,vehicles,type_name,fuel_common_name
|
2
|
-
Passenger cars gasoline age 0,0,0.25,0.25,10000.0,kilometres,1000,Passenger cars,gasoline
|
3
|
-
Light-duty trucks diesel age 2,2,0.15,0.15,20000.0,kilometres,2000,Light-duty trucks,diesel
|
@@ -1,3 +0,0 @@
|
|
1
|
-
name,ch4_emission_factor,ch4_emission_factor_units,n2o_emission_factor,n2o_emission_factor_units,type_name,fuel_common_name,control_name
|
2
|
-
Passenger cars gasoline epa tier 2,0.2,kilograms_per_kilometre,0.1,kilograms_per_kilometre,Passenger cars,gasoline,epa tier 2
|
3
|
-
Light-duty trucks diesel advanced,1,kilograms_per_litre,-1,grams
|
@@ -1,3 +0,0 @@
|
|
1
|
-
name,ch4_emission_factor,ch4_emission_factor_units,n2o_emission_factor,n2o_emission_factor_units,type_name,fuel_common_name,control_name
|
2
|
-
Passenger cars gasoline epa tier 2,0.2,kilograms_per_kilometre,0.1,kilograms_per_kilometre,Passenger cars,gasoline,epa tier 2
|
3
|
-
Light-duty trucks diesel advanced,0.4,kilograms_per_kilometre,0.2,kilograms_per_kilometre,Light-duty trucks,diesel,advanced
|
@@ -1,2 +0,0 @@
|
|
1
|
-
name,year,total_travel,fuel_consumption,ch4_emission_factor,n2o_emission_factor,total_travel_units,fuel_consumption_units,ch4_emission_factor_units,n2o_emission_factor_units,type_name,fuel_common_name,type_year_name
|
2
|
-
Passenger cars gasoline 2009,2009,0,-1,0,-1,miles,gallons,grams_per_mile,grams_per_mile
|
@@ -1,2 +0,0 @@
|
|
1
|
-
name,year,total_travel,fuel_consumption,ch4_emission_factor,n2o_emission_factor,total_travel_units,fuel_consumption_units,ch4_emission_factor_units,n2o_emission_factor_units,type_name,fuel_common_name,type_year_name
|
2
|
-
Passenger cars gasoline 2008,2008,1000,500,0.1,0.01,kilometres,litres,kilograms_per_litre,kilograms_per_litre,Passenger cars,gasoline,Passenger cars 2008
|
@@ -1,2 +0,0 @@
|
|
1
|
-
name,distance,distance_units,passengers,speed,speed_units,gasoline_intensity,gasoline_intensity_units,diesel_intensity,diesel_intensity_units,cng_intensity,cng_intensity_units,lng_intensity,lng_intensity_units,lpg_intensity,lpg_intensity_units,methanol_intensity,methanol_intensity_units,biodiesel_intensity,biodiesel_intensity_units,electricity_intensity,electricity_intensity_units,air_conditioning_emission_factor,air_conditioning_emission_factor_units,alternative_fuels_intensity,alternative_fuels_intensity_units
|
2
|
-
city transit,0,miles,0,0,miles_per_hour,-1,gallons_per_mile,0,gallons_per_mile,-1,gallons_per_mile,-1,gallons_per_mile,-1,gallons_per_mile,-1,gallons_per_mile,-1,gallons_per_mile,-1,kilowatt_hours_per_mile,0,pounds_co2e_per_mile,-1,gallons_per_mile
|
@@ -1,2 +0,0 @@
|
|
1
|
-
name,distance,distance_units,passengers,speed,speed_units,gasoline_intensity,gasoline_intensity_units,diesel_intensity,diesel_intensity_units,cng_intensity,cng_intensity_units,lng_intensity,lng_intensity_units,lpg_intensity,lpg_intensity_units,methanol_intensity,methanol_intensity_units,biodiesel_intensity,biodiesel_intensity_units,electricity_intensity,electricity_intensity_units,air_conditioning_emission_factor,air_conditioning_emission_factor_units,alternative_fuels_intensity,alternative_fuels_intensity_units
|
2
|
-
city transit,1,kilometres,1,1,kilometres_per_hour,0,litres_per_kilometre,1,litres_per_kilometre,0,litres_per_kilometre,0,litres_per_kilometre,0,litres_per_kilometre,0,litres_per_kilometre,0,litres_per_kilometre,0,kilowatt_hours_per_kilometre,1,kilograms_co2e_per_kilometre,0,litres_per_kilometre
|
@@ -1,3 +0,0 @@
|
|
1
|
-
name,co2_emission_factor,co2_emission_factor_units,co2_biogenic_emission_factor,co2_biogenic_emission_factor_units,ch4_emission_factor,ch4_emission_factor_units,n2o_emission_factor,n2o_emission_factor_units,fuel_name,energy_content,energy_content_units
|
2
|
-
CNG,-1,kilograms_per_gallon,-1,kilograms_per_gallon,0,kilograms_per_kilometre,0,kilograms_per_kilometre
|
3
|
-
LNG,1,kilograms_per_litre,0,kilograms_per_litre,0.1,kilograms_co2e_per_kilometre,0.1,kilograms_co2e_per_kilometre,Pipeline Natural Gas,0,btu_per_gallon
|
@@ -1,3 +0,0 @@
|
|
1
|
-
name,co2_emission_factor,co2_emission_factor_units,co2_biogenic_emission_factor,co2_biogenic_emission_factor_units,ch4_emission_factor,ch4_emission_factor_units,n2o_emission_factor,n2o_emission_factor_units,fuel_name,energy_content,energy_content_units
|
2
|
-
CNG,0,kilograms_per_litre,1,kilograms_per_litre,0.1,kilograms_co2e_per_kilometre,0.1,kilograms_co2e_per_kilometre,Pipeline Natural Gas
|
3
|
-
LNG,1,kilograms_per_litre,0,kilograms_per_litre,0.1,kilograms_co2e_per_kilometre,0.1,kilograms_co2e_per_kilometre,Pipeline Natural Gas,10,megajoules_per_litre
|
@@ -1,3 +0,0 @@
|
|
1
|
-
name,package_volume,route_inefficiency_factor,transport_emission_factor,corporate_emission_factor,transport_emission_factor_units,corporate_emission_factor_units
|
2
|
-
FedEx,100,1.0,0.1,0.1,kilograms_per_kilogram_kilometre,kilograms_per_package
|
3
|
-
UPS,1000,2.0,1.5,2.0,kilograms_per_kilogram_kilometre,kilograms_per_package
|
@@ -1,2 +0,0 @@
|
|
1
|
-
abbreviation,net_generation,net_generation_units,electricity_co2_emission_factor,electricity_co2_emission_factor_units,electricity_co2_biogenic_emission_factor,electricity_co2_biogenic_emission_factor_units,electricity_ch4_emission_factor,electricity_ch4_emission_factor_units,electricity_n2o_emission_factor,electricity_n2o_emission_factor_units,electricity_emission_factor,electricity_emission_factor_units,egrid_region_name
|
2
|
-
NEWE,0,kilowatt_hours,0,pounds_per_megawatt_hour,-1,pounds_per_megawatt_hour,0,pounds_per_gigawatt_hour,0,pounds_per_gigawatt_hour,0,pounds_per_megawatt_hour
|
@@ -1,2 +0,0 @@
|
|
1
|
-
abbreviation,net_generation,net_generation_units,electricity_co2_emission_factor,electricity_co2_emission_factor_units,electricity_co2_biogenic_emission_factor,electricity_co2_biogenic_emission_factor_units,electricity_ch4_emission_factor,electricity_ch4_emission_factor_units,electricity_n2o_emission_factor,electricity_n2o_emission_factor_units,electricity_emission_factor,electricity_emission_factor_units,egrid_region_name
|
2
|
-
NEWE,1350,megawatt_hours,0.4,kilograms_per_kilowatt_hour,0,kilograms_per_kilowatt_hour,0.001,kilograms_co2e_per_kilowatt_hour,0.002,kilograms_co2e_per_kilowatt_hour,0.4,kilograms_co2e_per_kilowatt_hour,E
|
@@ -1,2 +0,0 @@
|
|
1
|
-
name,year,energy_content,carbon_content,co2_emission_factor,co2_biogenic_emission_factor,energy_content_units,carbon_content_units,co2_emission_factor_units,co2_biogenic_emission_factor_units,fuel_name
|
2
|
-
Motor Gasoline 2008,2008,20,10,2,0,megajoules_per_litre,grams_per_megajoule,kilograms_per_litre,kilograms_per_litre,Motor Gasoline
|
@@ -1,3 +0,0 @@
|
|
1
|
-
name,passengers,distance,distance_units,speed,speed_units,electricity_intensity,electricity_intensity_units,diesel_intensity,diesel_intensity_units
|
2
|
-
commuter,100,50,kilometres,100,kilometres_per_hour,0.7,kilowatt_hours_per_kilometre,0,litres_per_kilometre
|
3
|
-
intercity,0,-20,distance_units,-1,speed_units,,elec_intense_units,-1
|
@@ -1,3 +0,0 @@
|
|
1
|
-
name,passengers,distance,distance_units,speed,speed_units,electricity_intensity,electricity_intensity_units,diesel_intensity,diesel_intensity_units
|
2
|
-
commuter,100,50,kilometres,100,kilometres_per_hour,0.7,kilowatt_hours_per_kilometre,0,litres_per_kilometre
|
3
|
-
intercity,150,200,kilometres,150,kilometres_per_hour,0.8,kilowatt_hours_per_kilometre,0.5,litres_per_kilometre
|
@@ -1,13 +0,0 @@
|
|
1
|
-
class AircraftInstanceSeatClass < ActiveRecord::Base
|
2
|
-
self.primary_key = "row_hash"
|
3
|
-
|
4
|
-
col :row_hash
|
5
|
-
col :seat_class_name
|
6
|
-
col :aircraft_instance_id
|
7
|
-
col :seats, :type => :integer
|
8
|
-
col :seat_pitch, :type => :float
|
9
|
-
col :seat_pitch_units
|
10
|
-
col :seat_width, :type => :float
|
11
|
-
col :seat_width_units
|
12
|
-
add_index :aircraft_instance_id
|
13
|
-
end
|
@@ -1,33 +0,0 @@
|
|
1
|
-
require 'earth/locality'
|
2
|
-
# Copyright 2011 Brighter Planet, Inc.
|
3
|
-
class LodgingProperty < ActiveRecord::Base
|
4
|
-
self.primary_key = "northstar_id"
|
5
|
-
|
6
|
-
# So Lodging can look up LodgingClass from LodgingProperty
|
7
|
-
belongs_to :lodging_class, :foreign_key => 'lodging_class_name'
|
8
|
-
|
9
|
-
col :northstar_id
|
10
|
-
col :name
|
11
|
-
col :city
|
12
|
-
col :locality # state / province / etc.
|
13
|
-
col :postcode # zip code / postal code / etc.
|
14
|
-
col :country_iso_3166_alpha_3_code
|
15
|
-
col :chain_name
|
16
|
-
col :lodging_rooms, :type => :integer
|
17
|
-
col :floors, :type => :integer
|
18
|
-
col :construction_year, :type => :integer
|
19
|
-
col :renovation_year, :type => :integer
|
20
|
-
col :lodging_class_name
|
21
|
-
col :restaurants, :type => :integer
|
22
|
-
col :ac_coverage, :type => :float
|
23
|
-
col :mini_bar_coverage, :type => :float
|
24
|
-
col :fridge_coverage, :type => :float
|
25
|
-
col :hot_tubs, :type => :float # float b/c fallback needs to be a float
|
26
|
-
col :pools_indoor, :type => :float # float b/c fallback needs to be a float
|
27
|
-
col :pools_outdoor, :type => :float # float b/c fallback needs to be a float
|
28
|
-
col :update_date
|
29
|
-
add_index :city
|
30
|
-
add_index :locality
|
31
|
-
add_index :postcode
|
32
|
-
add_index :country_iso_3166_alpha_3_code
|
33
|
-
end
|
@@ -1,35 +0,0 @@
|
|
1
|
-
# http://seejohncode.com/2011/09/16/uuids-and-find-in-batches
|
2
|
-
module CleanFindInBatches
|
3
|
-
def self.included(base)
|
4
|
-
base.class_eval do
|
5
|
-
alias :old_find_in_batches :find_in_batches
|
6
|
-
alias :find_in_batches :replacement_find_in_batches
|
7
|
-
end
|
8
|
-
end
|
9
|
-
|
10
|
-
# Override this here because of the implementation of regular find_in_batches
|
11
|
-
# conflicting with this class using UUIDs
|
12
|
-
def replacement_find_in_batches(options = {}, &block)
|
13
|
-
relation = self
|
14
|
-
return old_find_in_batches(options, &block) if relation.primary_key.is_a?(::Arel::Attributes::Integer)
|
15
|
-
# Throw errors like the real thing
|
16
|
-
if (finder_options = options.except(:batch_size)).present?
|
17
|
-
raise "You can't specify an order, it's forced to be #{batch_order}" if options[:order].present?
|
18
|
-
raise "You can't specify a limit, it's forced to be the batch_size" if options[:limit].present?
|
19
|
-
raise 'You can\'t specify start, it\'s forced to be 0 because the ID is a string' if options.delete(:start)
|
20
|
-
relation = apply_finder_options(finder_options)
|
21
|
-
end
|
22
|
-
# Compute the batch size
|
23
|
-
batch_size = options.delete(:batch_size) || 1000
|
24
|
-
offset = 0
|
25
|
-
# Get the relation and keep going over it until there's nothing left
|
26
|
-
relation = relation.except(:order).order(batch_order).limit(batch_size)
|
27
|
-
while (results = relation.offset(offset).limit(batch_size).all).any?
|
28
|
-
block.call results
|
29
|
-
offset += batch_size
|
30
|
-
end
|
31
|
-
nil
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
::ActiveRecord::Batches.send(:include, ::CleanFindInBatches)
|