USEPA/flowsa

duplicate functions for flow mapping

Opened this issue · 0 comments

SInce v2.0, there are two functions that handle flow mapping and they are not used consistently:

def map_flows(fba, from_fba_source, flow_type='ELEMENTARY_FLOW',
ignore_source_name=False, **kwargs):
"""
Applies mapping via esupy from fedelemflowlist or material
flow list to convert flows to standardized list of flows
:param fba: df flow-by-activity or flow-by-sector
:param from_fba_source: str Source name of fba list to look for mappings
:param flow_type: str either 'ELEMENTARY_FLOW', 'TECHNOSPHERE_FLOW',
or 'WASTE_FLOW'
:param ignore_source_name: bool, passed to apply_flow_mapping
:param kwargs: optional - keep_unmapped_rows: False if want
unmapped rows dropped, True if want to retain and keep_fba_columns:
boolean, True or False, indicate if want to maintain
'FlowName' and 'Compartment' columns in returned df
:return: df, with flows mapped using federal elementary flow list or
material flow list
"""

# TODO: probably only slight modification is needed to allow for material
# flow list mapping using this function as well.
def map_to_fedefl_list(
self: 'FlowByActivity',
drop_unmapped_rows: bool = False
) -> 'FlowByActivity':

I don't believe this is causing any errors but the duplication is confusing