From e646e6fccfcc5c3cc5fbf5f27d29ed1b6b6a40bb Mon Sep 17 00:00:00 2001 From: romainsacchi Date: Tue, 7 Mar 2023 09:59:53 +0000 Subject: [PATCH] Black reformating --- unfold/unfold.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/unfold/unfold.py b/unfold/unfold.py index 1df7b8d..1c24408 100644 --- a/unfold/unfold.py +++ b/unfold/unfold.py @@ -31,9 +31,9 @@ check_exchanges_input, check_for_duplicates, correct_fields_format, + get_list_of_unique_datasets, remove_categories_for_technosphere_flows, remove_missing_fields, - get_list_of_unique_datasets, ) from .export import UnfoldExporter from .utils import HiddenPrints @@ -693,11 +693,19 @@ def filter_out_datasets( """ # Get the list of datasets not used in the current scenario. - df_gr = self.scenario_df.groupby("to activity name").sum(numeric_only=True).loc[:, [scenario_name]] - datasets_not_in_scenario = df_gr.loc[df_gr[scenario_name] == 0, :].index.tolist() + df_gr = ( + self.scenario_df.groupby("to activity name") + .sum(numeric_only=True) + .loc[:, [scenario_name]] + ) + datasets_not_in_scenario = df_gr.loc[ + df_gr[scenario_name] == 0, : + ].index.tolist() # Remove datasets that are not in the current scenario. - database = [act for act in database if act["name"] not in datasets_not_in_scenario] + database = [ + act for act in database if act["name"] not in datasets_not_in_scenario + ] return database