diff --git a/unfold/data_cleaning.py b/unfold/data_cleaning.py index 44e869b..98caa12 100644 --- a/unfold/data_cleaning.py +++ b/unfold/data_cleaning.py @@ -427,6 +427,7 @@ def change_db_name(data, name): exc["input"] = (name, exc["input"][1]) return data + def clean_fields(database): for dataset in database: diff --git a/unfold/unfold.py b/unfold/unfold.py index 9e775fe..9b89d3c 100644 --- a/unfold/unfold.py +++ b/unfold/unfold.py @@ -34,7 +34,7 @@ get_outdated_units, remove_categories_for_technosphere_flows, remove_missing_fields, - clean_fields + clean_fields, ) try: @@ -84,9 +84,17 @@ def get_list_unique_exchanges(databases: list) -> list: [ ( exchange["name"].strip(), - exchange.get("product").strip() if exchange.get("product") else None, + ( + exchange.get("product").strip() + if exchange.get("product") + else None + ), exchange.get("categories"), - exchange.get("location").strip() if exchange.get("location") else None, + ( + exchange.get("location").strip() + if exchange.get("location") + else None + ), exchange.get("unit").strip(), exchange.get("type").strip(), ) @@ -586,7 +594,11 @@ def populate_sparse_matrix(self) -> nsp.lil_matrix: # Destination activity c = ( ds["name"].strip(), - ds.get("reference product").strip() if ds.get("reference product") else None, + ( + ds.get("reference product").strip() + if ds.get("reference product") + else None + ), ds.get("categories"), ds.get("location").strip() if ds.get("location") else None, ds["unit"].strip(),