Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/mc' into mc
Browse files Browse the repository at this point in the history
# Conflicts:
#	dev/timing.py
  • Loading branch information
romainsacchi committed Jul 31, 2024
2 parents 66e051c + bcfaf89 commit 64aca2c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
4 changes: 1 addition & 3 deletions pathways/pathways.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
12 changes: 3 additions & 9 deletions pathways/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down

0 comments on commit 64aca2c

Please sign in to comment.