earth 0.3.11 → 0.3.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. data/Gemfile.lock +7 -3
  2. data/features/automobile_fuel_type.feature +8 -18
  3. data/features/automobile_make_fleet_year.feature +4 -4
  4. data/features/automobile_make_model_year.feature +4 -4
  5. data/features/automobile_make_model_year_variant.feature +4 -4
  6. data/features/automobile_make_year.feature +4 -4
  7. data/features/automobile_size_class_year.feature +34 -0
  8. data/features/automobile_type_fuel_age.feature +54 -0
  9. data/features/automobile_type_fuel_control.feature +34 -0
  10. data/features/automobile_type_fuel_year.feature +54 -0
  11. data/features/automobile_type_fuel_year_control.feature +34 -0
  12. data/features/automobile_type_year.feature +44 -0
  13. data/features/computation_platform.feature +14 -0
  14. data/features/data_center_company.feature +14 -0
  15. data/features/egrid_region.feature +6 -0
  16. data/features/egrid_subregion.feature +4 -4
  17. data/features/flight_segment.feature +14 -0
  18. data/features/fuel_year.feature +44 -0
  19. data/features/greenhouse_gas.feature +44 -0
  20. data/features/server_type.feature +34 -0
  21. data/features/server_type_alias.feature +14 -0
  22. data/features/support/imports/automobile_make_fleet_year_bad.csv +1 -2
  23. data/features/support/imports/automobile_make_fleet_year_good.csv +1 -2
  24. data/features/support/imports/automobile_size_class_year_bad.csv +2 -0
  25. data/features/support/imports/automobile_size_class_year_good.csv +2 -0
  26. data/features/support/imports/automobile_type_fuel_age_bad.csv +3 -0
  27. data/features/support/imports/automobile_type_fuel_age_good.csv +3 -0
  28. data/features/support/imports/automobile_type_fuel_control_bad.csv +3 -0
  29. data/features/support/imports/automobile_type_fuel_control_good.csv +3 -0
  30. data/features/support/imports/automobile_type_fuel_year_bad.csv +2 -0
  31. data/features/support/imports/automobile_type_fuel_year_control_bad.csv +3 -0
  32. data/features/support/imports/automobile_type_fuel_year_control_good.csv +3 -0
  33. data/features/support/imports/automobile_type_fuel_year_good.csv +2 -0
  34. data/features/support/imports/automobile_type_year_bad.csv +2 -0
  35. data/features/support/imports/automobile_type_year_good.csv +2 -0
  36. data/features/support/imports/computation_platform_bad.csv +3 -0
  37. data/features/support/imports/computation_platform_good.csv +3 -0
  38. data/features/support/imports/data_center_company_bad.csv +3 -0
  39. data/features/support/imports/data_center_company_good.csv +3 -0
  40. data/features/support/imports/egrid_subregion_good.csv +2 -2
  41. data/features/support/imports/flight_segment_bad.csv +8 -0
  42. data/features/support/imports/flight_segment_good.csv +8 -0
  43. data/features/support/imports/fuel_year_bad.csv +2 -0
  44. data/features/support/imports/fuel_year_good.csv +2 -0
  45. data/features/support/imports/greenhouse_gas_bad.csv +2 -0
  46. data/features/support/imports/greenhouse_gas_good.csv +2 -0
  47. data/features/support/imports/server_type_alias_bad.csv +3 -0
  48. data/features/support/imports/server_type_alias_good.csv +3 -0
  49. data/features/support/imports/server_type_bad.csv +3 -0
  50. data/features/support/imports/server_type_good.csv +3 -0
  51. data/lib/earth/air/aircraft.rb +2 -3
  52. data/lib/earth/air/aircraft/data_miner.rb +2 -4
  53. data/lib/earth/air/aircraft_class/data_miner.rb +3 -1
  54. data/lib/earth/air/airport/data_miner.rb +4 -3
  55. data/lib/earth/air/flight_distance_class/data_miner.rb +2 -0
  56. data/lib/earth/air/flight_seat_class/data_miner.rb +4 -4
  57. data/lib/earth/air/flight_segment/data_miner.rb +7 -0
  58. data/lib/earth/all.rb +1 -0
  59. data/lib/earth/automobile.rb +6 -0
  60. data/lib/earth/automobile/automobile_fuel_type/data_miner.rb +68 -25
  61. data/lib/earth/automobile/automobile_make_fleet_year/data_miner.rb +5 -6
  62. data/lib/earth/automobile/automobile_make_model/data_miner.rb +1 -2
  63. data/lib/earth/automobile/automobile_make_model_year/data_miner.rb +3 -4
  64. data/lib/earth/automobile/automobile_make_model_year_variant/data_miner.rb +14 -10
  65. data/lib/earth/automobile/automobile_make_year/data_miner.rb +2 -2
  66. data/lib/earth/automobile/automobile_size_class/data_miner.rb +28 -26
  67. data/lib/earth/automobile/automobile_size_class_year.rb +7 -0
  68. data/lib/earth/automobile/automobile_size_class_year/data_miner.rb +56 -0
  69. data/lib/earth/automobile/automobile_type_fuel_age.rb +7 -0
  70. data/lib/earth/automobile/automobile_type_fuel_age/data_miner.rb +195 -0
  71. data/lib/earth/automobile/automobile_type_fuel_control.rb +7 -0
  72. data/lib/earth/automobile/automobile_type_fuel_control/data_miner.rb +57 -0
  73. data/lib/earth/automobile/automobile_type_fuel_year.rb +7 -0
  74. data/lib/earth/automobile/automobile_type_fuel_year/data_miner.rb +164 -0
  75. data/lib/earth/automobile/automobile_type_fuel_year_control.rb +7 -0
  76. data/lib/earth/automobile/automobile_type_fuel_year_control/data_miner.rb +46 -0
  77. data/lib/earth/automobile/automobile_type_year.rb +7 -0
  78. data/lib/earth/automobile/automobile_type_year/data_miner.rb +55 -0
  79. data/lib/earth/automobile/data_miner.rb +6 -0
  80. data/lib/earth/computation.rb +4 -0
  81. data/lib/earth/computation/computation_platform.rb +9 -0
  82. data/lib/earth/computation/computation_platform/data_miner.rb +24 -0
  83. data/lib/earth/computation/data_center_company.rb +7 -0
  84. data/lib/earth/computation/data_center_company/data_miner.rb +22 -0
  85. data/lib/earth/computation/data_miner.rb +4 -0
  86. data/lib/earth/computation/server_type.rb +9 -0
  87. data/lib/earth/computation/server_type/data_miner.rb +49 -0
  88. data/lib/earth/computation/server_type_alias.rb +10 -0
  89. data/lib/earth/computation/server_type_alias/data_miner.rb +30 -0
  90. data/lib/earth/data_miner.rb +1 -0
  91. data/lib/earth/fuel.rb +2 -0
  92. data/lib/earth/fuel/data_miner.rb +2 -0
  93. data/lib/earth/fuel/fuel_year.rb +7 -0
  94. data/lib/earth/fuel/fuel_year/data_miner.rb +76 -0
  95. data/lib/earth/fuel/greenhouse_gas.rb +7 -0
  96. data/lib/earth/fuel/greenhouse_gas/data_miner.rb +59 -0
  97. data/lib/earth/locality/country/data_miner.rb +1 -1
  98. data/lib/earth/locality/egrid_region/data_miner.rb +8 -0
  99. data/lib/earth/locality/egrid_subregion/data_miner.rb +3 -3
  100. data/lib/earth/locality/urbanity/data_miner.rb +2 -2
  101. data/lib/earth/locality/zip_code/data_miner.rb +2 -3
  102. data/lib/earth/residence/air_conditioner_use/data_miner.rb +2 -2
  103. data/lib/earth/residence/clothes_machine_use/data_miner.rb +3 -3
  104. data/lib/earth/residence/dishwasher_use/data_miner.rb +1 -1
  105. data/lib/earth/residence/residence_class/data_miner.rb +2 -2
  106. data/lib/earth/residence/residential_energy_consumption_survey_response.rb +4 -4
  107. data/lib/earth/residence/residential_energy_consumption_survey_response/data_miner.rb +3 -4
  108. data/spec/earth_spec.rb +4 -5
  109. metadata +196 -81
@@ -0,0 +1,14 @@
1
+ Feature: Data import for ComputationPlatform
2
+ As a data user
3
+ I want to import ComputationPlatform data
4
+ So that I can perform computation platform-based calculations
5
+
6
+ Scenario: Successfully verifying that data center company name is never missing
7
+ Given a "ComputationPlatform" data import fetches results listed in "computation_platform_good"
8
+ When a data import verifies "Data center company name should never be missing"
9
+ Then the verification should be successful
10
+
11
+ Scenario: Failing to verify that data center company name is never missing
12
+ Given a "ComputationPlatform" data import fetches results listed in "computation_platform_bad"
13
+ When a data import verifies "Data center company name should never be missing"
14
+ Then the verification should not be successful
@@ -0,0 +1,14 @@
1
+ Feature: Data import for DataCenterCompany
2
+ As a data user
3
+ I want to import DataCenterCompany data
4
+ So that I can perform data center company-based calculations
5
+
6
+ Scenario: Successfully verifying that power usage effectiveness >= 1.0
7
+ Given a "DataCenterCompany" data import fetches results listed in "data_center_company_good"
8
+ When a data import verifies "Power usage effectiveness should be one or more"
9
+ Then the verification should be successful
10
+
11
+ Scenario: Failing to verify that power usage effectiveness >= 1.0
12
+ Given a "DataCenterCompany" data import fetches results listed in "data_center_company_bad"
13
+ When a data import verifies "Power usage effectiveness should be one or more"
14
+ Then the verification should not be successful
@@ -8,6 +8,12 @@ Feature: Data import for EgridRegion
8
8
  When a data import verifies "Loss factor should be greater than zero and less than one"
9
9
  Then the verification should be successful
10
10
 
11
+ # FIXME TODO get this to work
12
+ # Scenario: Successfully verifying that fallback loss factor is greater than zero and less than one
13
+ # Given a "EgridRegion" data import fetches results listed in "egrid_region_good"
14
+ # When a data import verifies "Fallback loss factor should be greater than zero and less than one"
15
+ # Then the verification should be successful
16
+
11
17
  Scenario: Failing to verify that loss factor is greater than zero and less than one
12
18
  Given a "EgridRegion" data import fetches results listed in "egrid_region_bad"
13
19
  When a data import verifies "Loss factor should be greater than zero and less than one"
@@ -14,9 +14,9 @@ Feature: Data import for EgridSubregion
14
14
  When a data import verifies "Electricity emission factor should be greater than zero"
15
15
  Then the verification should be successful
16
16
 
17
- Scenario: Successfully verifying that electricity emission factor units are kilograms per kilowatt hour
17
+ Scenario: Successfully verifying that electricity emission factor units are kilograms co2e per kilowatt hour
18
18
  Given a "EgridSubregion" data import fetches results listed in "egrid_subregion_good"
19
- When a data import verifies "Electricity emission factor units should be kilograms per kilowatt hour"
19
+ When a data import verifies "Electricity emission factor units should be kilograms co2e per kilowatt hour"
20
20
  Then the verification should be successful
21
21
 
22
22
  # FIXME TODO
@@ -30,7 +30,7 @@ Feature: Data import for EgridSubregion
30
30
  When a data import verifies "Electricity emission factor should be greater than zero"
31
31
  Then the verification should not be successful
32
32
 
33
- Scenario: Failing to verify that electricity emission factor units are kilograms per kilowatt hour
33
+ Scenario: Failing to verify that electricity emission factor units are kilograms co2e per kilowatt hour
34
34
  Given a "EgridSubregion" data import fetches results listed in "egrid_subregion_bad"
35
- When a data import verifies "Electricity emission factor units should be kilograms per kilowatt hour"
35
+ When a data import verifies "Electricity emission factor units should be kilograms co2e per kilowatt hour"
36
36
  Then the verification should not be successful
@@ -0,0 +1,14 @@
1
+ Feature: Data import for FlightSegment
2
+ As a data user
3
+ I want to import FlightSegment data
4
+ So that I can look up T-100 flight segment data
5
+
6
+ Scenario: Successfully verifying that FlightSegments have related Aircraft
7
+ Given a "FlightSegment" data import fetches results listed in "flight_segment_good"
8
+ When a data import verifies "All segments have an associated aircraft"
9
+ Then the verification should be successful
10
+
11
+ Scenario: Failing to verify that FlightSegments have related Aircraft
12
+ Given a "FlightSegment" data import fetches results listed in "flight_segment_bad"
13
+ When a data import verifies "All segments have an associated aircraft"
14
+ Then the verification should not be successful
@@ -0,0 +1,44 @@
1
+ Feature: Data import for FuelYear
2
+ As a data user
3
+ I want to import FuelYear data
4
+ So that I can perform fuel year control-based calculations
5
+
6
+ Scenario: Successfully verifying that fuel name and fuel common name are never missing
7
+ Given a "FuelYear" data import fetches results listed in "fuel_year_good"
8
+ When a data import verifies "Fuel name and fuel common name should never be missing"
9
+ Then the verification should be successful
10
+
11
+ Scenario: Successfully verifying that year is from 1990 to 2008
12
+ Given a "FuelYear" data import fetches results listed in "fuel_year_good"
13
+ When a data import verifies "Year should be from 1990 to 2008"
14
+ Then the verification should be successful
15
+
16
+ Scenario: Successfully verifying that carbon content, energy content, and CO2 emission factor are greater than zero
17
+ Given a "FuelYear" data import fetches results listed in "fuel_year_good"
18
+ When a data import verifies "Carbon content, energy content, and CO2 emission factor should be greater than zero"
19
+ Then the verification should be successful
20
+
21
+ Scenario: Successfully verifying that units are correct
22
+ Given a "FuelYear" data import fetches results listed in "fuel_year_good"
23
+ When a data import verifies "Units should be correct"
24
+ Then the verification should be successful
25
+
26
+ Scenario: Failing to verify that fuel name and fuel common name are never missing
27
+ Given a "FuelYear" data import fetches results listed in "fuel_year_bad"
28
+ When a data import verifies "Fuel name and fuel common name should never be missing"
29
+ Then the verification should not be successful
30
+
31
+ Scenario: Failing to verify that year is from 1990 to 2008
32
+ Given a "FuelYear" data import fetches results listed in "fuel_year_bad"
33
+ When a data import verifies "Year should be from 1990 to 2008"
34
+ Then the verification should not be successful
35
+
36
+ Scenario: Failing to verify that carbon content, energy content, and CO2 emission factor are greater than zero
37
+ Given a "FuelYear" data import fetches results listed in "fuel_year_bad"
38
+ When a data import verifies "Carbon content, energy content, and CO2 emission factor should be greater than zero"
39
+ Then the verification should not be successful
40
+
41
+ Scenario: Failing to verify that units are correct
42
+ Given a "FuelYear" data import fetches results listed in "fuel_year_bad"
43
+ When a data import verifies "Units should be correct"
44
+ Then the verification should not be successful
@@ -0,0 +1,44 @@
1
+ Feature: Data import for GreenhouseGas
2
+ As a data user
3
+ I want to import GreenhouseGas data
4
+ So that I can perform global warming potential-based calculations
5
+
6
+ Scenario: Successfully verifying that abbreviation and IPCC report are never missing
7
+ Given a "GreenhouseGas" data import fetches results listed in "greenhouse_gas_good"
8
+ When a data import verifies "Abbreviation and IPCC report should never be missing"
9
+ Then the verification should be successful
10
+
11
+ Scenario: Successfully verifying that time horizon is 100
12
+ Given a "GreenhouseGas" data import fetches results listed in "greenhouse_gas_good"
13
+ When a data import verifies "Time horizon should be 100"
14
+ Then the verification should be successful
15
+
16
+ Scenario: Successfully verifying that time horizon units are years
17
+ Given a "GreenhouseGas" data import fetches results listed in "greenhouse_gas_good"
18
+ When a data import verifies "Time horizon units should be years"
19
+ Then the verification should be successful
20
+
21
+ Scenario: Successfully verifying that global warming potential is one or more
22
+ Given a "GreenhouseGas" data import fetches results listed in "greenhouse_gas_good"
23
+ When a data import verifies "Global warming potential should be one or more"
24
+ Then the verification should be successful
25
+
26
+ Scenario: Failing to verify that abbreviation and IPCC report are never missing
27
+ Given a "GreenhouseGas" data import fetches results listed in "greenhouse_gas_bad"
28
+ When a data import verifies "Abbreviation and IPCC report should never be missing"
29
+ Then the verification should not be successful
30
+
31
+ Scenario: Failing to verify that time horizon is 100
32
+ Given a "GreenhouseGas" data import fetches results listed in "greenhouse_gas_bad"
33
+ When a data import verifies "Time horizon should be 100"
34
+ Then the verification should not be successful
35
+
36
+ Scenario: Failing to verify that time horizon units are years
37
+ Given a "GreenhouseGas" data import fetches results listed in "greenhouse_gas_bad"
38
+ When a data import verifies "Time horizon units should be years"
39
+ Then the verification should not be successful
40
+
41
+ Scenario: Failing to verify that global warming potential is one or more
42
+ Given a "GreenhouseGas" data import fetches results listed in "greenhouse_gas_bad"
43
+ When a data import verifies "Global warming potential should be one or more"
44
+ Then the verification should not be successful
@@ -0,0 +1,34 @@
1
+ Feature: Data import for ServerType
2
+ As a data user
3
+ I want to import ServerType data
4
+ So that I can perform server type-based calculations
5
+
6
+ Scenario: Successfully verifying that data center company name is never missing
7
+ Given a "ServerType" data import fetches results listed in "server_type_good"
8
+ When a data import verifies "Data center company name should never be missing"
9
+ Then the verification should be successful
10
+
11
+ Scenario: Successfully verifying that electricity draw is more than zero
12
+ Given a "ServerType" data import fetches results listed in "server_type_good"
13
+ When a data import verifies "Electricity draw should be more than zero"
14
+ Then the verification should be successful
15
+
16
+ Scenario: Successfully verifying that electricity draw units are kilowatts
17
+ Given a "ServerType" data import fetches results listed in "server_type_good"
18
+ When a data import verifies "Electricity draw units should be kilowatts"
19
+ Then the verification should be successful
20
+
21
+ Scenario: Failing to verify that data center company name is never missing
22
+ Given a "ServerType" data import fetches results listed in "server_type_bad"
23
+ When a data import verifies "Data center company name should never be missing"
24
+ Then the verification should not be successful
25
+
26
+ Scenario: Failing to verify that electricity draw is more than zero
27
+ Given a "ServerType" data import fetches results listed in "server_type_bad"
28
+ When a data import verifies "Electricity draw should be more than zero"
29
+ Then the verification should not be successful
30
+
31
+ Scenario: Failing to verify that electricity draw units are kilowatts
32
+ Given a "ServerType" data import fetches results listed in "server_type_bad"
33
+ When a data import verifies "Electricity draw units should be kilowatts"
34
+ Then the verification should not be successful
@@ -0,0 +1,14 @@
1
+ Feature: Data import for ServerTypeAlias
2
+ As a data user
3
+ I want to import ServerTypeAlias data
4
+ So that I can perform server type alias-based calculations
5
+
6
+ Scenario: Successfully verifying that server type name and platform name are never missing
7
+ Given a "ServerTypeAlias" data import fetches results listed in "server_type_alias_good"
8
+ When a data import verifies "Server type name and platform name should never be missing"
9
+ Then the verification should be successful
10
+
11
+ Scenario: Failing to verify that server type name and platform name are never missing
12
+ Given a "ServerTypeAlias" data import fetches results listed in "server_type_alias_bad"
13
+ When a data import verifies "Server type name and platform name should never be missing"
14
+ Then the verification should not be successful
@@ -1,3 +1,2 @@
1
1
  name,year,fuel_efficiency,volume,fuel_efficiency_units
2
- Toyota 2000 IP,2000,10,1000,kilometres_per_litre
3
- Honda 2008 DP,2008,0,0
2
+ Honda 2010 DP,2010,0,0
@@ -1,3 +1,2 @@
1
1
  name,year,fuel_efficiency,volume,fuel_efficiency_units
2
- Toyota 2000 IP,2000,10,1000,kilometres_per_litre
3
- Honda 2007 DP,2007,15,2000,kilometres_per_litre
2
+ Honda 2009 DP,2009,15,2000,kilometres_per_litre
@@ -0,0 +1,2 @@
1
+ name,year,fuel_efficiency_city,fuel_efficiency_highway,fuel_efficiency_city_units,fuel_efficiency_highway_units
2
+ Small car 2010,2011,0,-1,miles_per_gallon,miles_per_gallon
@@ -0,0 +1,2 @@
1
+ name,year,fuel_efficiency_city,fuel_efficiency_highway,fuel_efficiency_city_units,fuel_efficiency_highway_units
2
+ Small car 2010,2010,20,25,kilometres_per_litre,kilometres_per_litre
@@ -0,0 +1,3 @@
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,-1,0,1,0,miles
@@ -0,0 +1,3 @@
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
@@ -0,0 +1,3 @@
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
@@ -0,0 +1,3 @@
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
@@ -0,0 +1,2 @@
1
+ name,year,total_travel,fuel_consumption,ch4_emission_factor,n2o_emission_factor,hfc_emission_factor,total_travel_units,fuel_consumption_units,ch4_emission_factor_units,n2o_emission_factor_units,hfc_emission_factor_units,type_name,fuel_common_name
2
+ Light-duty trucks diesel 2010,2010,0,-1,0,-1,-1,miles,gallons,grams_per_mile,grams_per_mile,co2e
@@ -0,0 +1,3 @@
1
+ name,year,total_travel_percent,type_name,fuel_common_name,control_name
2
+ Passenger cars gasoline 2008 epa tier 2,2008,0.9,Passenger cars,gasoline,epa tier 2
3
+ Light-duty trucks diesel 2008 epa advanced,2009,0.1
@@ -0,0 +1,3 @@
1
+ name,year,total_travel_percent,type_name,fuel_common_name,control_name
2
+ Passenger cars gasoline 2008 epa tier 2,2008,0.9,Passenger cars,gasoline,epa tier 2
3
+ Light-duty trucks diesel 2008 epa advanced,2008,-1,Light-duty trucks,diesel,advanced
@@ -0,0 +1,2 @@
1
+ name,year,total_travel,fuel_consumption,ch4_emission_factor,n2o_emission_factor,hfc_emission_factor,total_travel_units,fuel_consumption_units,ch4_emission_factor_units,n2o_emission_factor_units,hfc_emission_factor_units,type_name,fuel_common_name
2
+ Passenger cars gasoline 2000,2000,1000,500,0.01,0.001,0,kilometres,litres,kilograms_per_litre,kilograms_per_litre,kilograms_co2e_per_litre,Passenger cars,gasoline
@@ -0,0 +1,2 @@
1
+ name,year,hfc_emissions,hfc_emissions_units,type_name
2
+ Passenger cars 2008,2009,-1,pounds
@@ -0,0 +1,2 @@
1
+ name,year,hfc_emissions,hfc_emissions_units,type_name
2
+ Passenger cars 2008,2008,1000,kilograms_co2e,Passenger cars
@@ -0,0 +1,3 @@
1
+ name,data_center_company_name
2
+ Heroku,Amazon
3
+ Engine Yard
@@ -0,0 +1,3 @@
1
+ name,data_center_company_name
2
+ Heroku,Amazon
3
+ Engine Yard,Amazon
@@ -0,0 +1,3 @@
1
+ name,power_usage_effectiveness
2
+ Swift Servers,1.5
3
+ Disorganized Servers
@@ -0,0 +1,3 @@
1
+ name,power_usage_effectiveness
2
+ Swift Servers,1.5
3
+ Super Efficient Servers,1.0
@@ -1,3 +1,3 @@
1
1
  name,egrid_region_name,electricity_emission_factor,electricity_emission_factor_units
2
- US,US,1.2,kilograms_per_kilowatt_hour
3
- AKGD,AK,0.9,kilograms_per_kilowatt_hour
2
+ US,US,1.2,kilograms_co2e_per_kilowatt_hour
3
+ AKGD,AK,0.9,kilograms_co2e_per_kilowatt_hour
@@ -0,0 +1,8 @@
1
+ origin_airport_iata_code,destination_airport_iata_code,airline_iata_code,aircraft_bts_code,distance,distance_units,departures_performed,passengers,total_seats,seats,freight,freight_units,payload,payload_units,load_factor,freight_share
2
+ ADA,AIA,DA,1,185.2,kilometres,1,100,125,125,100,kilograms,10100,kilograms,0.8,0.00990
3
+ ADA,AIA,DA,2,185.2,kilometres,1,100,120,120,200,kilograms,10200,kilograms,0.833333333,0.01961
4
+ AIA,WEA,IA,2,1852,kilometres,1,100,120,120,500,kilograms,10500,kilograms,0.833333333,0.04762
5
+ AIA,WEA,IA,,1852,kilometres,1,100,120,120,500,kilograms,10500,kilograms,0.833333333,0.04762
6
+ AIA,WEA,EA,3,1852,kilometres,1,100,130,130,1000,kilograms,11000,kilograms,0.769230769,0.09091
7
+ AZP,BZP,ZA,,185.2,kilometres,1,0,110,110,100,kilograms,10100,kilograms,0.8,0.009990
8
+ AZP,BZP,ZA,6,185.2,kilometres,1,0,110,110,100,kilograms,10100,kilograms,0.8,0.009990
@@ -0,0 +1,8 @@
1
+ origin_airport_iata_code,destination_airport_iata_code,airline_iata_code,aircraft_bts_code,distance,distance_units,departures_performed,passengers,total_seats,seats,freight,freight_units,payload,payload_units,load_factor,freight_share
2
+ ADA,AIA,DA,1,185.2,kilometres,1,100,125,125,100,kilograms,10100,kilograms,0.8,0.00990
3
+ ADA,AIA,DA,2,185.2,kilometres,1,100,120,120,200,kilograms,10200,kilograms,0.833333333,0.01961
4
+ AIA,WEA,IA,2,1852,kilometres,1,100,120,120,500,kilograms,10500,kilograms,0.833333333,0.04762
5
+ AIA,WEA,IA,2,1852,kilometres,1,100,120,120,500,kilograms,10500,kilograms,0.833333333,0.04762
6
+ AIA,WEA,EA,3,1852,kilometres,1,100,130,130,1000,kilograms,11000,kilograms,0.769230769,0.09091
7
+ AZP,BZP,ZA,6,185.2,kilometres,1,0,110,110,100,kilograms,10100,kilograms,0.8,0.009990
8
+ AZP,BZP,ZA,6,185.2,kilometres,1,0,110,110,100,kilograms,10100,kilograms,0.8,0.009990
@@ -0,0 +1,2 @@
1
+ name,year,carbon_content,energy_content,co2_emission_factor,carbon_content_units,energy_content_units,co2_emission_factor_units,fuel_name,fuel_common_name
2
+ Motor Gasoline 2008,2009,0,-1,0,foo,bar,pounds_per_gallon
@@ -0,0 +1,2 @@
1
+ name,year,carbon_content,energy_content,co2_emission_factor,carbon_content_units,energy_content_units,co2_emission_factor_units,fuel_name,fuel_common_name
2
+ Motor Gasoline 2008,2008,19.5,5.2,2.3,teragrams_per_quadrillion_btu,million_btu_per_barrel,kilograms_per_litre,Motor Gasoline,gasoline
@@ -0,0 +1,2 @@
1
+ name,time_horizon,time_horizon_units,global_warming_potential,abbreviation,ipcc_report
2
+ Carbon dioxide,20,months,0
@@ -0,0 +1,2 @@
1
+ name,time_horizon,time_horizon_units,global_warming_potential,abbreviation,ipcc_report
2
+ Carbon dioxide,100,years,1,co2,AR4
@@ -0,0 +1,3 @@
1
+ name,server_type_name,platform_name
2
+ Fugu,Normal,Heroku
3
+ Large
@@ -0,0 +1,3 @@
1
+ name,server_type_name,platform_name
2
+ Fugu,Normal,Heroku
3
+ Large,Large,Engine Yard
@@ -0,0 +1,3 @@
1
+ name,memory,memory_units,cpu,cpu_units,electricity_draw,electricity_draw_units,data_center_company_name
2
+ Normal,1.7,gigabytes,1,ec2_compute_units,2.3,kilowatts,Amazon
3
+ Large,7.5,gigabytes,4,ec2_compute_units,0,gigawatts
@@ -0,0 +1,3 @@
1
+ name,data_center_company_name,memory,memory_units,cpu,cpu_units,electricity_draw,electricity_draw_units
2
+ Normal,Amazon,1.7,gigabytes,1,ec2_compute_units,2.3,kilowatts
3
+ Large,Amazon,1.7,gigabytes,1,ec2_compute_units,4.0,kilowatts
@@ -1,15 +1,14 @@
1
1
  class Aircraft < ActiveRecord::Base
2
2
  set_primary_key :bp_code
3
3
 
4
+ belongs_to :manufacturer, :foreign_key => 'manufacturer_name', :primary_key => 'name', :class_name => 'AircraftManufacturer'
4
5
  belongs_to :aircraft_class, :foreign_key => 'class_code', :primary_key => 'code'
5
6
  has_many :segments, :foreign_key => 'aircraft_bts_code', :primary_key => 'bts_code', :class_name => 'FlightSegment'
6
- # belongs_to :manufacturer, :foreign_key => 'icao_manufacturer_name', :primary_key => 'name', :class_name => 'AircraftManufacturer'
7
7
 
8
8
  falls_back_on :m3 => lambda { weighted_average(:m3, :weighted_by => [:segments, :passengers]) }, # 9.73423082858437e-08 r7110: 8.6540464368905e-8 r6972: 8.37e-8
9
9
  :m2 => lambda { weighted_average(:m2, :weighted_by => [:segments, :passengers]) }, # -0.000134350543484608 r7110: -0.00015337661447817 r6972: -4.09e-5
10
10
  :m1 => lambda { weighted_average(:m1, :weighted_by => [:segments, :passengers]) }, # 6.7728101555467 r7110: 4.7781966869412 r6972: 7.85
11
- :endpoint_fuel => lambda { weighted_average(:endpoint_fuel, :weighted_by => [:segments, :passengers]) }, # 1527.81790006167 r7110: 1065.3476555284 r6972: 1.72e3
12
- :seats => lambda { weighted_average(:seats, :weighted_by => [:segments, :passengers]) } # 62.1741
11
+ :endpoint_fuel => lambda { weighted_average(:endpoint_fuel, :weighted_by => [:segments, :passengers]) } # 1527.81790006167 r7110: 1065.3476555284 r6972: 1.72e3
13
12
 
14
13
  data_miner do
15
14
  tap "Brighter Planet's sanitized aircraft data", Earth.taps_server
@@ -200,8 +200,6 @@ Aircraft.class_eval do
200
200
  # update_all "weighting = (#{segments.project(segments[:passengers].sum).where(aircraft[:aircraft_type_code].eq(segments[:aircraft_type_code])).to_sql})"
201
201
  end
202
202
 
203
- process "Synthesize AircraftManufacturer" do
204
- AircraftManufacturer.run_data_miner!
205
- end
206
- end
203
+ # FIXME TODO verify this
204
+ end
207
205
  end
@@ -10,7 +10,7 @@ AircraftClass.class_eval do
10
10
  float 'seats'
11
11
  end
12
12
 
13
- import "Brighter Planet's aircraft classes",
13
+ import "a list of Brighter Planet-defined aircraft classes",
14
14
  :url => 'https://spreadsheets.google.com/pub?key=0AoQJbWqPrREqdGNBbHFibmxJUFprQkUwZHp6VU51Smc&hl=en&single=true&gid=0&output=csv' do
15
15
  key 'code', :field_name => 'aircraft_class_code'
16
16
  store 'name'
@@ -27,5 +27,7 @@ AircraftClass.class_eval do
27
27
  update_all "#{column} = (#{relation.to_sql})"
28
28
  end
29
29
  end
30
+
31
+ # FIXME TODO verify this
30
32
  end
31
33
  end
@@ -48,7 +48,7 @@ Airport.class_eval do
48
48
  # end
49
49
  # end
50
50
  # end
51
-
51
+
52
52
  process "Determine whether each airport serves international flights" do
53
53
  FlightSegment.run_data_miner!
54
54
  update_all 'international_origin = 1','(SELECT COUNT(*) FROM flight_segments WHERE flight_segments.origin_airport_iata_code = airports.iata_code AND flight_segments.origin_country_iso_3166_code != flight_segments.destination_country_iso_3166_code AND flight_segments.origin_country_iso_3166_code IS NOT NULL AND flight_segments.destination_country_iso_3166_code IS NOT NULL LIMIT 1) > 0'
@@ -60,7 +60,7 @@ Airport.class_eval do
60
60
  FlightSegment.run_data_miner!
61
61
  segments = FlightSegment.arel_table
62
62
  airports = Airport.arel_table
63
-
63
+
64
64
  find_in_batches do |batch|
65
65
  batch.each do |airport|
66
66
  targeting_relation = airports[:iata_code].eq airport.iata_code
@@ -75,6 +75,7 @@ Airport.class_eval do
75
75
  end
76
76
  end
77
77
  end
78
+
79
+ # FIXME TODO verify this
78
80
  end
79
81
  end
80
-