From 228ff44f75de10d4174409776cca7328185815ab Mon Sep 17 00:00:00 2001 From: Thomas Kouroughli Date: Wed, 17 Jan 2024 13:50:32 +0000 Subject: [PATCH 1/2] :recycle: address pandas FutureWarning --- scripts/build_electricity_production.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build_electricity_production.py b/scripts/build_electricity_production.py index beb859bdf..e89ad78b0 100644 --- a/scripts/build_electricity_production.py +++ b/scripts/build_electricity_production.py @@ -58,7 +58,7 @@ gen = client.query_generation(country, start=start, end=end, nett=True) gen = gen.tz_localize(None).resample("1h").mean() gen = gen.loc[start.tz_localize(None) : end.tz_localize(None)] - gen = gen.rename(columns=carrier_grouper).groupby(level=0, axis=1).sum() + gen = gen.rename(columns=carrier_grouper).T.groupby(level=0).sum().T generation.append(gen) except NoMatchingDataError: unavailable_countries.append(country) From aaa587d34f84dc22f7662d7f5855ae1e1f2161fa Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 17 Jan 2024 13:51:03 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- scripts/build_transport_demand.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/build_transport_demand.py b/scripts/build_transport_demand.py index be8ad4141..33c8faaef 100644 --- a/scripts/build_transport_demand.py +++ b/scripts/build_transport_demand.py @@ -13,9 +13,7 @@ import numpy as np import pandas as pd import xarray as xr - -from _helpers import configure_logging -from _helpers import generate_periodic_profiles +from _helpers import configure_logging, generate_periodic_profiles logger = logging.getLogger(__name__) @@ -137,8 +135,10 @@ def bev_availability_profile(fn, snapshots, nodes, options): ) if not avail[avail < 0].empty: - logger.warning("The BEV availability weekly profile has negative values which can " - "lead to infeasibility.") + logger.warning( + "The BEV availability weekly profile has negative values which can " + "lead to infeasibility." + ) return generate_periodic_profiles( dt_index=snapshots,