From bcfaf89f0506fec0aca7c0c5bde0e6497a7b2235 Mon Sep 17 00:00:00 2001 From: romainsacchi Date: Wed, 31 Jul 2024 14:37:38 +0000 Subject: [PATCH] Black reformating --- dev/timing.py | 2 +- pathways/pathways.py | 4 +--- pathways/stats.py | 12 +++--------- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/dev/timing.py b/dev/timing.py index ca56d2f..f9aa716 100644 --- a/dev/timing.py +++ b/dev/timing.py @@ -3,7 +3,7 @@ p = Pathways( datapackage="remind-SSP2-PkBudg1150-stem-SPS1.zip", geography_mapping="geo_mapping_remind.yaml", - #activities_mapping="act_categories_agg.yaml", + # activities_mapping="act_categories_agg.yaml", ) vars = [v for v in p.scenarios.coords["variables"].values if v.startswith("FE")] diff --git a/pathways/pathways.py b/pathways/pathways.py index 50564fc..275e56f 100644 --- a/pathways/pathways.py +++ b/pathways/pathways.py @@ -21,9 +21,7 @@ from .filesystem_constants import DATA_DIR, USER_LOGS_DIR from .lca import _calculate_year, get_lca_matrices from .lcia import get_lcia_method_names -from .stats import ( - log_mc_parameters_to_excel, -) +from .stats import log_mc_parameters_to_excel from .subshares import generate_samples from .utils import ( _get_mapping, diff --git a/pathways/stats.py b/pathways/stats.py index c2d78ff..6329647 100644 --- a/pathways/stats.py +++ b/pathways/stats.py @@ -432,9 +432,7 @@ def run_gsa(directory: [str, None] = STATS_DIR, method: str = "delta") -> None: for file in Path(directory).rglob("*.xlsx"): # load content of "Monte Carlo values" sheet into a pandas DataFrame - df_mc_vals = pd.read_excel( - file, sheet_name="Monte Carlo values" - ) + df_mc_vals = pd.read_excel(file, sheet_name="Monte Carlo values") # load content of "Technology shares" sheet into a pandas DataFrame # if it exists @@ -448,14 +446,10 @@ def run_gsa(directory: [str, None] = STATS_DIR, method: str = "delta") -> None: df_technology_shares = None # load content of "Total impacts" sheet into a pandas DataFrame - df_sum_impacts = pd.read_excel( - file, sheet_name="Total impacts" - ) + df_sum_impacts = pd.read_excel(file, sheet_name="Total impacts") # open Excel workbook - with pd.ExcelWriter( - file, engine="openpyxl", mode="a" - ) as writer: + with pd.ExcelWriter(file, engine="openpyxl", mode="a") as writer: df_GSA_results = run_GSA_delta( total_impacts=df_sum_impacts,