From c0716ef2bd84c186b875dd23c0b41f6f59c2005d Mon Sep 17 00:00:00 2001 From: Ben Young Date: Wed, 22 May 2024 13:43:07 -0400 Subject: [PATCH] add exports; assign elementary flow only to production table --- flowsa/data_source_scripts/EIA_MER.py | 10 +++++++++- flowsa/methods/flowbyactivitymethods/EIA_MER.yaml | 1 + 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/flowsa/data_source_scripts/EIA_MER.py b/flowsa/data_source_scripts/EIA_MER.py index ad74009d..0e0537bc 100644 --- a/flowsa/data_source_scripts/EIA_MER.py +++ b/flowsa/data_source_scripts/EIA_MER.py @@ -70,6 +70,10 @@ def parse_tables(desc): # desc = 'T01.04A: Petroleum Products, Excluding Biofuels, Imports' flow = d.split('Imports')[0].strip().rstrip(',') return (flow, None, d.strip()) + elif tbl == 'T01.04B': + # desc = 'T01.04B: Coal Coke Exports' + flow = d.split('Exports')[0].strip().rstrip(',') + return (flow, d.strip(), None) elif tbl == 'T02.02': # desc = 'T02.02: Total Energy Consumed by the Residential Sector' flow = d.split('Consumed')[0].strip() @@ -123,7 +127,11 @@ def eia_mer_parse(*, df_list, year, config, **_): df['Class'] = 'Energy' df['SourceName'] = 'EIA_MER' df['Location'] = '00000' - df['FlowType'] = 'ELEMENTARY_FLOW' + + df['FlowType'] = np.where(df['Description'].isin(['T01.02']), + 'ELEMENTARY_FLOW', + 'TECHNOSPHERE_FLOW') + # Fill in the rest of the Flow by fields so they show # "None" instead of nan. df['Compartment'] = 'None' diff --git a/flowsa/methods/flowbyactivitymethods/EIA_MER.yaml b/flowsa/methods/flowbyactivitymethods/EIA_MER.yaml index e99ce5e8..cda72c29 100644 --- a/flowsa/methods/flowbyactivitymethods/EIA_MER.yaml +++ b/flowsa/methods/flowbyactivitymethods/EIA_MER.yaml @@ -16,6 +16,7 @@ tbls: - T01.02 # Primary energy production by source - T01.03 # Primary energy consumption by source - T01.04A # Primary energy imports by source +- T01.04B # Primary energy exports by source - T02.02 # Residential sector energy consumption - TA2 # Heat content of Petroleum production, imports, exports - TA4 # Heat content of Natural gas