Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/204.fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix failing tests due to updated ANGA inventory
8 changes: 4 additions & 4 deletions tests/integration/test_inventory_inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ def all_sector_meta():

def test_inventory_get_sector_emissions_by_code(all_sector_meta, inventory_df):
expected_annual_emissions = {
"agriculture": 153367168.6905247,
"coal": 901455051.0124934,
"agriculture": 153367168.69052473,
"coal": 901455051.0124931,
"electricity": 11164637.314332796,
"industrial": 2937681.1201194106,
"lulucf": 661762727.6374531,
"oil_gas": 238171271.587112,
"oil_gas": 266446833.76762065,
"stationary": 73354555.56013045,
"transport": 11702390.307919662,
"transport": 7027522.398009392,
"waste": 481160233.5451011,
}

Expand Down
36 changes: 18 additions & 18 deletions tests/integration/test_om_prior.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@ def test_009_prior_emissions_ds(prior_emissions_ds):
assert dataset_metrics(prior_emissions_ds) == {
'max': {
'LANDMASK': 1.0,
'OCH4_TOTAL': 8.106117813512767e-09,
'OCH4_TOTAL': 8.105908627681788e-09,
'ch4_sector_agriculture': 1.3196047170278112e-12,
'ch4_sector_coal': 8.072982591959402e-09,
'ch4_sector_coal': 8.072982591959399e-09,
'ch4_sector_electricity': 1.2683449229281463e-11,
'ch4_sector_fire': 5.498670963000052e-11,
'ch4_sector_industrial': 5.351265777744653e-13,
'ch4_sector_livestock': 7.545056510007907e-11,
'ch4_sector_lulucf': 1.4454168861914367e-10,
'ch4_sector_oil_gas': 5.671488137556794e-11,
'ch4_sector_oil_gas': 5.6714881375567926e-11,
'ch4_sector_stationary': 1.3362230506306242e-11,
'ch4_sector_termite': 3.38580183854853e-12,
'ch4_sector_transport': 2.1317017815070317e-12,
'ch4_sector_transport': 1.28013009489856e-12,
'ch4_sector_waste': 2.817024580114932e-12,
'ch4_sector_wetlands': 9.336642787030613e-13,
'ch4_total': 8.106117813512767e-09,
'ch4_total': 8.105908627681788e-09,
'lambert_conformal': 0,
'land_mask': 1,
'lat': -22.806066513061523,
Expand All @@ -29,21 +29,21 @@ def test_009_prior_emissions_ds(prior_emissions_ds):
},
'mean': {
'LANDMASK': 1.0,
'OCH4_TOTAL': 4.52822599704719e-10,
'OCH4_TOTAL': 4.527375484529345e-10,
'ch4_sector_agriculture': 1.0532989458203914e-12,
'ch4_sector_coal': 3.979529404503476e-10,
'ch4_sector_coal': 3.979529404503474e-10,
'ch4_sector_electricity': 2.2548354185389268e-13,
'ch4_sector_fire': 3.6974516872713414e-13,
'ch4_sector_industrial': 5.344609974538503e-14,
'ch4_sector_livestock': 4.0547154335803873e-11,
'ch4_sector_lulucf': 7.935998439039457e-12,
'ch4_sector_oil_gas': 5.671488137556793e-13,
'ch4_sector_oil_gas': 5.671488137556792e-13,
'ch4_sector_stationary': 1.3345610816621784e-12,
'ch4_sector_termite': 2.436579367090519e-12,
'ch4_sector_transport': 2.129050411132023e-13,
'ch4_sector_transport': 1.27853789328799e-13,
'ch4_sector_waste': 4.6656960187772004e-14,
'ch4_sector_wetlands': 8.66815276056264e-14,
'ch4_total': 4.52822599704719e-10,
'ch4_total': 4.527375484529345e-10,
'lambert_conformal': 0.0,
'land_mask': 1.0,
'lat': -23.267749786376953,
Expand All @@ -53,9 +53,9 @@ def test_009_prior_emissions_ds(prior_emissions_ds):
},
'x_band': {
'LANDMASK': 10.0,
'OCH4_TOTAL': 3.882923353318124e-09,
'OCH4_TOTAL': 3.881333541002702e-09,
'ch4_sector_agriculture': 2.4194872992444853e-11,
'ch4_sector_coal': 2.85589757264367e-09,
'ch4_sector_coal': 2.8558975726436694e-09,
'ch4_sector_electricity': 0.0,
'ch4_sector_fire': 0.0,
'ch4_sector_industrial': 9.990360612431248e-13,
Expand All @@ -64,19 +64,19 @@ def test_009_prior_emissions_ds(prior_emissions_ds):
'ch4_sector_oil_gas': 0.0,
'ch4_sector_stationary': 2.494615421637521e-11,
'ch4_sector_termite': 4.7307820855158056e-11,
'ch4_sector_transport': 3.979706932888128e-12,
'ch4_sector_transport': 2.389894617466093e-12,
'ch4_sector_waste': 0.0,
'ch4_sector_wetlands': 1.1796965896142583e-12,
'ch4_total': 3.882923353318124e-09,
'ch4_total': 3.881333541002702e-09,
'land_mask': 10,
'lat': -232.6233367919922,
'lon': 1486.8963623046875,
},
'y_band': {
'LANDMASK': 10.0,
'OCH4_TOTAL': 1.7230827813533157e-08,
'OCH4_TOTAL': 1.723023891570012e-08,
'ch4_sector_agriculture': 2.3428548325447984e-11,
'ch4_sector_coal': 1.6145965183918805e-08,
'ch4_sector_coal': 1.6145965183918798e-08,
'ch4_sector_electricity': 0.0,
'ch4_sector_fire': 0.0,
'ch4_sector_industrial': 3.7006265826194363e-13,
Expand All @@ -85,10 +85,10 @@ def test_009_prior_emissions_ds(prior_emissions_ds):
'ch4_sector_oil_gas': 0.0,
'ch4_sector_stationary': 9.240547464560038e-12,
'ch4_sector_termite': 4.639714307197451e-11,
'ch4_sector_transport': 1.4741619285048626e-12,
'ch4_sector_transport': 8.852640954771137e-13,
'ch4_sector_waste': 0.0,
'ch4_sector_wetlands': 7.814475668897097e-13,
'ch4_total': 1.7230827813533157e-08,
'ch4_total': 1.723023891570012e-08,
'land_mask': 10,
'lat': -232.2213897705078,
'lon': 1486.336669921875,
Expand Down
8 changes: 4 additions & 4 deletions tests/integration/test_sector_oil_gas/test_oil_gas_sector.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ def test_oil_gas_sector_pre_sgm(input_files, oil_gas_config_params, start_date,

# config.cache_inputs()

assert prior_oil_gas_ds['ch4_total'].max().item() == 5.671488137556794e-11
assert prior_oil_gas_ds['ch4_sector_oil_gas'].max().item() == 5.671488137556794e-11
assert prior_oil_gas_ds['ch4_total'].max().item() == 5.6714881375567926e-11
assert prior_oil_gas_ds['ch4_sector_oil_gas'].max().item() == 5.6714881375567926e-11

assert prior_oil_gas_ds['ch4_total'].mean().item() == 5.671488137556793e-13
assert prior_oil_gas_ds['ch4_sector_oil_gas'].mean().item() == 5.671488137556793e-13
assert prior_oil_gas_ds['ch4_total'].mean().item() == 5.671488137556792e-13
assert prior_oil_gas_ds['ch4_sector_oil_gas'].mean().item() == 5.671488137556792e-13


def test_oil_gas_sector_post_sgm(input_files, oil_gas_config_params):
Expand Down
Loading