Skip to content

Commit

Permalink
add exports; assign elementary flow only to production table
Browse files Browse the repository at this point in the history
  • Loading branch information
bl-young committed May 22, 2024
1 parent bdf7c61 commit c0716ef
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
10 changes: 9 additions & 1 deletion flowsa/data_source_scripts/EIA_MER.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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'
Expand Down
1 change: 1 addition & 0 deletions flowsa/methods/flowbyactivitymethods/EIA_MER.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c0716ef

Please sign in to comment.