Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

duplicate functions for flow mapping #419

Open
bl-young opened this issue Jun 21, 2024 · 0 comments
Open

duplicate functions for flow mapping #419

bl-young opened this issue Jun 21, 2024 · 0 comments
Labels
invalid This doesn't seem right

Comments

@bl-young
Copy link
Collaborator

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

@bl-young bl-young added the invalid This doesn't seem right label Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

1 participant