From 62f722ec871bf2126fd7d6d9386488123358029b Mon Sep 17 00:00:00 2001 From: Emre-Yorat89 Date: Sat, 24 Jan 2026 12:39:36 +0300 Subject: [PATCH 1/8] submodule update --- pypsa-earth | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pypsa-earth b/pypsa-earth index 0ee924ba..2a23ebe7 160000 --- a/pypsa-earth +++ b/pypsa-earth @@ -1 +1 @@ -Subproject commit 0ee924bad34316a09bea76b14f3c3ba9384e37c3 +Subproject commit 2a23ebe75f3763c14d85ea624bcf12df5e4c7b06 From 4aaef8ebbc3225b0f76b996041f037706114df81 Mon Sep 17 00:00:00 2001 From: Emre-Yorat89 Date: Sat, 24 Jan 2026 17:07:18 +0300 Subject: [PATCH 2/8] fix for deprecated profile freq definition --- scripts/ramp_build_demand_profile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ramp_build_demand_profile.py b/scripts/ramp_build_demand_profile.py index 32a977ae..b2ad559d 100644 --- a/scripts/ramp_build_demand_profile.py +++ b/scripts/ramp_build_demand_profile.py @@ -63,7 +63,7 @@ def create_demand_profile( profile = pd.DataFrame( data=data, - index=pd.date_range(start=date_start, periods=1440 * n_days, freq="T"), + index=pd.date_range(start=date_start, periods=1440 * n_days, freq="min"), ) # Reshape to obtain hourly average values: From a004ac23e9e93e45d6c6e6ff1b73c642ec1d223a Mon Sep 17 00:00:00 2001 From: Emre-Yorat89 Date: Sat, 24 Jan 2026 17:13:33 +0300 Subject: [PATCH 3/8] fix for pandas freq = "1H" error --- scripts/ramp_build_demand_profile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/ramp_build_demand_profile.py b/scripts/ramp_build_demand_profile.py index b2ad559d..e9561b6c 100644 --- a/scripts/ramp_build_demand_profile.py +++ b/scripts/ramp_build_demand_profile.py @@ -79,7 +79,7 @@ def create_demand_profile( daily_profile = pd.DataFrame( daily_profile, columns=[f"Day_{i+1}" for i in range(num_groups)] ) - date_index = pd.date_range(start="00:00", periods=24, freq="1H").time + date_index = pd.date_range(start="00:00", periods=24, freq="h").time daily_profile.index = date_index # Calculation of the mean value and standard deviation to represent a typical day From ee16e4958fd573515014f804fbd41ee94a36ddcf Mon Sep 17 00:00:00 2001 From: Emre-Yorat89 Date: Sat, 24 Jan 2026 17:35:01 +0300 Subject: [PATCH 4/8] fix attempt for build_shape issue --- scripts/build_shapes.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/build_shapes.py b/scripts/build_shapes.py index 0635c475..45ca6430 100644 --- a/scripts/build_shapes.py +++ b/scripts/build_shapes.py @@ -38,10 +38,10 @@ def create_microgrid_shapes(microgrids_list, output_path, country_code): # Extract the bounds of the rectangle for the current microgrid values = microgrids_list_df.iloc[:, col] # Define the vertices of the rectangle - Top_left = (values[0], values[3]) - Top_right = (values[1], values[3]) - Bottom_right = (values[1], values[2]) - Bottom_left = (values[0], values[2]) + Top_left = (values.iloc[0], values.iloc[3]) + Top_right = (values.iloc[1], values.iloc[3]) + Bottom_right = (values.iloc[1], values.iloc[2]) + Bottom_left = (values.iloc[0], values.iloc[2]) # Create a Polygon shape from the rectangle's vertices microgrid_shape = Polygon( [Top_left, Top_right, Bottom_right, Bottom_left, Top_left] From d748c7bbb6bdaf5553d2da7e7c129b7036edb29f Mon Sep 17 00:00:00 2001 From: Emre-Yorat89 Date: Sat, 24 Jan 2026 17:40:41 +0300 Subject: [PATCH 5/8] The same commit is applied for other instances of values[*] in build_shapes --- scripts/build_shapes.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/build_shapes.py b/scripts/build_shapes.py index 45ca6430..1e4d35fd 100644 --- a/scripts/build_shapes.py +++ b/scripts/build_shapes.py @@ -93,10 +93,10 @@ def create_bus_regions(microgrids_list, output_path, country_code): microgrid_name = microgrids_list_df.columns[col] + "_gen_bus" # Define the vertices of the rectangle - Top_left = (values[0], values[3]) - Top_right = (values[1], values[3]) - Bottom_right = (values[1], values[2]) - Bottom_left = (values[0], values[2]) + Top_left = (values.iloc[0], values.iloc[3]) + Top_right = (values.iloc[1], values.iloc[3]) + Bottom_right = (values.iloc[1], values.iloc[2]) + Bottom_left = (values.iloc[0], values.iloc[2]) # Create a Polygon shape from the rectangle's vertices microgrid_shape = Polygon( @@ -108,8 +108,8 @@ def create_bus_regions(microgrids_list, output_path, country_code): microgrid_names.append(microgrid_name) # Calculate the center of the rectangle - x = (values[0] + values[1]) / 2 - y = (values[2] + values[3]) / 2 + x = (values.iloc[0] + values.iloc[1]) / 2 + y = (values.iloc[2] + values.iloc[3]) / 2 microgrid_x.append(x) # Append the x-coordinate of the center microgrid_y.append(y) # Append the y-coordinate of the center From 29c5e88ff5c7ddee17141c1e5fe77e8971a77c2c Mon Sep 17 00:00:00 2001 From: Emre-Yorat89 Date: Sun, 25 Jan 2026 14:19:51 +0300 Subject: [PATCH 6/8] Check which pypsa version CI is using --- scripts/create_network.py | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/create_network.py b/scripts/create_network.py index c6d87f5d..4a6f6d49 100644 --- a/scripts/create_network.py +++ b/scripts/create_network.py @@ -352,4 +352,5 @@ def create_microgrid_network( snakemake.input["load"], ) a = 12 + print("PyPSA version:", pypsa.__version__) n.export_to_netcdf(snakemake.output[0]) From 974e2ff75549c4c23ed1abfbbf00c5f6fdc8ee3a Mon Sep 17 00:00:00 2001 From: Emre-Yorat89 Date: Sun, 25 Jan 2026 20:17:20 +0300 Subject: [PATCH 7/8] version check for CI --- scripts/create_network.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/create_network.py b/scripts/create_network.py index 4a6f6d49..e378b301 100644 --- a/scripts/create_network.py +++ b/scripts/create_network.py @@ -5,6 +5,7 @@ import os from itertools import combinations +import xarray as xr import geopandas as gpd import matplotlib.pyplot as plt import numpy as np @@ -353,4 +354,8 @@ def create_microgrid_network( ) a = 12 print("PyPSA version:", pypsa.__version__) + print("python :", __import__("sys").version) + print("pandas :", pd.__version__) + print("numpy :", np.__version__) + print("xarray :", xr.__version__) n.export_to_netcdf(snakemake.output[0]) From 020d094eb3e31c2228681c92a5abb1cae730b230 Mon Sep 17 00:00:00 2001 From: Emre-Yorat89 Date: Sun, 25 Jan 2026 20:51:35 +0300 Subject: [PATCH 8/8] Check and correction for dtype: string --- scripts/create_network.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/create_network.py b/scripts/create_network.py index e378b301..18654834 100644 --- a/scripts/create_network.py +++ b/scripts/create_network.py @@ -245,6 +245,13 @@ def create_microgrid_network( df.index = df["line_name"] df.drop("line_name", axis=1, inplace=True) n.import_components_from_dataframe(df, "Line") + for c in n.iterate_components(): + # Cast all column data + c.df[:] = c.df.apply(lambda s: s.astype(object) if str(s.dtype) == "string" else s) + # Cast index + c.df.index = c.df.index.astype(object) + # Cast column names + c.df.columns = c.df.columns.astype(object) # def add_bus_at_center(n, number_microgrids, voltage_level, line_type):