From cc9d577a7fcd021dc53a289b8edaa654307d9e5a Mon Sep 17 00:00:00 2001 From: ClaraBuettner Date: Thu, 8 Aug 2024 11:24:34 +0200 Subject: [PATCH 01/22] Remove dropping generators without installed capacities This is already part of adjust_network --- etrago/appl.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/etrago/appl.py b/etrago/appl.py index baa99462..f26743c1 100644 --- a/etrago/appl.py +++ b/etrago/appl.py @@ -682,13 +682,6 @@ def run_etrago(args, json_path): # import network from database etrago.build_network_from_db() - # drop generators without p_nom - etrago.network.mremove( - "Generator", - etrago.network.generators[ - etrago.network.generators.p_nom==0].index - ) - # Temporary drop DLR as it is currently not working with sclopf if (etrago.args["method"]["type"] == "sclopf") & ( not etrago.network.lines_t.s_max_pu.empty): From 4377e3494e9b989c0a081ca2637e7f0d1829285e Mon Sep 17 00:00:00 2001 From: ClaraBuettner Date: Thu, 8 Aug 2024 11:30:56 +0200 Subject: [PATCH 02/22] Move dropping DLR in case SCLOPF is selected --- etrago/appl.py | 8 -------- etrago/tools/utilities.py | 12 ++++++++++++ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/etrago/appl.py b/etrago/appl.py index f26743c1..d19b32ac 100644 --- a/etrago/appl.py +++ b/etrago/appl.py @@ -682,14 +682,6 @@ def run_etrago(args, json_path): # import network from database etrago.build_network_from_db() - # Temporary drop DLR as it is currently not working with sclopf - if (etrago.args["method"]["type"] == "sclopf") & ( - not etrago.network.lines_t.s_max_pu.empty): - print("Setting s_max_pu timeseries to 1") - etrago.network.lines_t.s_max_pu = pd.DataFrame( - index=etrago.network.snapshots, - ) - # adjust network regarding eTraGo setting etrago.adjust_network() diff --git a/etrago/tools/utilities.py b/etrago/tools/utilities.py index eb63e603..662b8b55 100755 --- a/etrago/tools/utilities.py +++ b/etrago/tools/utilities.py @@ -2963,3 +2963,15 @@ def manual_fixes_datamodel(etrago): ].index, inplace=True, ) + + # Temporary drop DLR as it is currently not working with sclopf + if (etrago.args["method"]["type"] == "sclopf") & ( + not etrago.network.lines_t.s_max_pu.empty): + print( + """ + Dynamic line rating is not implemented for the sclopf yet. + Setting s_max_pu timeseries to 1 + """) + etrago.network.lines_t.s_max_pu = pd.DataFrame( + index=etrago.network.snapshots, + ) From e9c29ff48cf1aefcecb2bc5566fb7db4aba6746e Mon Sep 17 00:00:00 2001 From: ClaraBuettner Date: Thu, 8 Aug 2024 11:32:15 +0200 Subject: [PATCH 03/22] Drop manual fixes from run-etrago --- etrago/appl.py | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/etrago/appl.py b/etrago/appl.py index d19b32ac..3019abb5 100644 --- a/etrago/appl.py +++ b/etrago/appl.py @@ -690,26 +690,14 @@ def run_etrago(args, json_path): # spatial clustering etrago.spatial_clustering() - etrago.spatial_clustering_gas() - etrago.network.links.loc[etrago.network.links.carrier=="CH4", "p_nom"] *= 100 - etrago.network.generators_t.p_max_pu.where(etrago.network.generators_t.p_max_pu>1e-5, other=0., inplace=True) + # snapshot clustering etrago.snapshot_clustering() # skip snapshots etrago.skip_snapshots() - # Temporary drop DLR as it is currently not working with sclopf - if etrago.args["method"]["type"] != "lopf": - etrago.network.lines_t.s_max_pu = pd.DataFrame( - index=etrago.network.snapshots, - columns=etrago.network.lines.index, - data=1.0, - ) - - etrago.network.lines.loc[etrago.network.lines.r == 0.0, "r"] = 10 - # start linear optimal powerflow calculations etrago.optimize() From b0790f35dce17bd78cf42c3bee17095d35573629 Mon Sep 17 00:00:00 2001 From: ClaraBuettner Date: Thu, 8 Aug 2024 11:34:16 +0200 Subject: [PATCH 04/22] Drop outdated comment --- etrago/appl.py | 1 - 1 file changed, 1 deletion(-) diff --git a/etrago/appl.py b/etrago/appl.py index 3019abb5..d5f74368 100644 --- a/etrago/appl.py +++ b/etrago/appl.py @@ -708,7 +708,6 @@ def run_etrago(args, json_path): etrago.pf_post_lopf() # spatial disaggregation - # needs to be adjusted for new sectors etrago.spatial_disaggregation() # calculate central etrago results From 61fb26650111c6b3ad2e35f77009222ccbb74814 Mon Sep 17 00:00:00 2001 From: ClaraBuettner Date: Thu, 8 Aug 2024 11:39:30 +0200 Subject: [PATCH 05/22] Apply black --- etrago/tools/utilities.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/etrago/tools/utilities.py b/etrago/tools/utilities.py index 662b8b55..1d76285f 100755 --- a/etrago/tools/utilities.py +++ b/etrago/tools/utilities.py @@ -2966,12 +2966,14 @@ def manual_fixes_datamodel(etrago): # Temporary drop DLR as it is currently not working with sclopf if (etrago.args["method"]["type"] == "sclopf") & ( - not etrago.network.lines_t.s_max_pu.empty): + not etrago.network.lines_t.s_max_pu.empty + ): print( """ Dynamic line rating is not implemented for the sclopf yet. Setting s_max_pu timeseries to 1 - """) + """ + ) etrago.network.lines_t.s_max_pu = pd.DataFrame( index=etrago.network.snapshots, ) From 85ac40cc7063c580fd93a0384cf53ec28cd4264a Mon Sep 17 00:00:00 2001 From: ClaraBuettner Date: Thu, 15 Aug 2024 09:27:02 +0200 Subject: [PATCH 06/22] Remove duplicate entries from calc_dispatch per carrier and avoid warnings There were entries for each generator (assuming that there is only one generator for each bus and carrier). But when redispatch is eplicitly considered, there are up to three generators for each combination. To avoid duplicate entries, only unique combinations are used as an index for the series --- etrago/analyze/plot.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/etrago/analyze/plot.py b/etrago/analyze/plot.py index 07dd75d6..d8616acc 100644 --- a/etrago/analyze/plot.py +++ b/etrago/analyze/plot.py @@ -841,16 +841,18 @@ def calc_dispatch_per_carrier(network, timesteps, dispatch_type="total"): ] dist = pd.Series( - index=pd.MultiIndex.from_tuples(index, names=["bus", "carrier"]), + index=pd.MultiIndex.from_tuples( + index, names=["bus", "carrier"] + ).unique(), dtype=float, - ) + ).sort_index() for i in dist.index: gens = network.generators[ (network.generators.bus == i[0]) & (network.generators.carrier == i[1]) ].index - dist[i] = ( + dist.loc[i] = ( ( network.generators_t.p[gens].transpose()[ network.snapshots[timesteps] From bfb932d86d19fdb9bcaf1ac39f5783619c33d9f5 Mon Sep 17 00:00:00 2001 From: ClaraBuettner Date: Thu, 15 Aug 2024 09:36:30 +0200 Subject: [PATCH 07/22] Avoid deprecation warning when initializing the busmap --- etrago/cluster/spatial.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etrago/cluster/spatial.py b/etrago/cluster/spatial.py index 9f782c1d..30d7779e 100755 --- a/etrago/cluster/spatial.py +++ b/etrago/cluster/spatial.py @@ -759,7 +759,7 @@ def kmedoids_dijkstra_clustering( kmeans.fit(points) busmap = pd.Series( - data=kmeans.predict(buses.loc[buses_i, ["x", "y"]]), + data=kmeans.predict(buses.loc[buses_i, ["x", "y"]].values), index=buses_i, dtype=object, ) From e432de95f866d01f8606e2d36679fce294b50d33 Mon Sep 17 00:00:00 2001 From: ClaraBuettner Date: Thu, 15 Aug 2024 11:28:48 +0200 Subject: [PATCH 08/22] Delete print statement --- etrago/execute/market_optimization.py | 1 - 1 file changed, 1 deletion(-) diff --git a/etrago/execute/market_optimization.py b/etrago/execute/market_optimization.py index e175ed44..6d8eb5b1 100644 --- a/etrago/execute/market_optimization.py +++ b/etrago/execute/market_optimization.py @@ -209,7 +209,6 @@ def optimize_with_rolling_horizon( n.storage_units.state_of_charge_initial = ( n.storage_units_t.state_of_charge.loc[snapshots[start - 1]] ) - print(i) # Make sure that state of charge of batteries and pumped hydro # plants are cyclic over the year by using the state_of_charges # from the pre_market_model From b65302ace7c2c764238647fc842d8aff7c048893 Mon Sep 17 00:00:00 2001 From: birgits Date: Tue, 20 Aug 2024 11:29:59 +0200 Subject: [PATCH 09/22] Add function to export network to shape files --- etrago/tools/utilities.py | 115 +++++++++++++++++++++++++++++++++++++- 1 file changed, 114 insertions(+), 1 deletion(-) diff --git a/etrago/tools/utilities.py b/etrago/tools/utilities.py index 3214981e..7b292586 100755 --- a/etrago/tools/utilities.py +++ b/etrago/tools/utilities.py @@ -36,7 +36,7 @@ import sqlalchemy.exc if "READTHEDOCS" not in os.environ: - from shapely.geometry import Point + from shapely.geometry import Point, LineString import geopandas as gpd from etrago.tools import db @@ -2973,3 +2973,116 @@ def manual_fixes_datamodel(etrago): ].index, inplace=True, ) + + +def export_to_shapefile(pypsa_network, shape_files_path=None, srid=4326): + """ + Translates all component DataFrames within the pypsa network + to GeoDataFrames and saves them to shape files. + + Shape files can be used to plot the network in QGIS. + + Currently, only the AC network is exported. + + Parameters + ---------- + pypsa_network : PyPSA network + PyPSA network as in etrago.network. + shape_files_path : str or None + If provided, geodataframes are saved as shapefiles to given directory. + Default: None. + srid : int + SRID bus coordinates are given in. Per default WGS84 is assumed. + Default: 4326. + + Returns + ------- + dict + Dictionary with geodataframes. + + """ + os.makedirs(shape_files_path, exist_ok=True) + + # convert buses_df + buses_df = pypsa_network.buses[pypsa_network.buses.carrier == "AC"] + buses_df = buses_df.assign( + geometry=gpd.points_from_xy(buses_df.x, buses_df.y, crs=f"EPSG:{srid}") + ).drop(columns=["x", "y", "geom"]) + + buses_gdf = gpd.GeoDataFrame(buses_df, crs=f"EPSG:{srid}") + + # convert component DataFrames + components = [ + "generators", + "loads", + "storage_units", + "stores", + "transformers", + ] + components_dict = {"buses_gdf": buses_gdf} + + for component in components: + left_on = "bus1" if component == "transformers" else "bus" + + attr = getattr(pypsa_network, component) + + components_dict[f"{component}_gdf"] = gpd.GeoDataFrame( + attr.merge( + buses_gdf[["geometry", "v_nom"]], left_on=left_on, right_index=True + ), + crs=f"EPSG:{srid}", + ) + if components_dict[f"{component}_gdf"].empty: + components_dict[f"{component}_gdf"].index = components_dict[ + f"{component}_gdf" + ].index.astype(object) + + # convert lines + lines_df = pypsa_network.lines + lines_df = lines_df.drop(columns=["geom"]) + + lines_gdf = lines_df.merge( + buses_gdf[["geometry", "v_nom"]].rename(columns={"geometry": "geom_0"}), + left_on="bus0", right_index=True + ) + lines_gdf = lines_gdf.merge( + buses_gdf[["geometry"]].rename(columns={"geometry": "geom_1"}), + left_on="bus1", right_index=True + ) + lines_gdf["geometry"] = lines_gdf.apply( + lambda _: LineString([_["geom_0"], _["geom_1"]]), + axis=1 + ) + lines_gdf = gpd.GeoDataFrame(lines_gdf, crs=f"EPSG:{srid}") + components_dict["lines_gdf"] = lines_gdf + + save_cols = { + "buses_gdf": ["scn_name", "v_nom", "carrier", "country", "geometry"], + "generators_gdf": [ + "scn_name", "bus", "carrier", "p_nom", "p_nom_extendable", "v_nom", + "geometry" + ], + "loads_gdf": ["scn_name", "bus", "carrier", "v_nom", "geometry"], + "storage_units_gdf": [ + "scn_name", "bus", "carrier", "p_nom", "p_nom_extendable", "v_nom", + "geometry" + ], + "stores_gdf": [ + "scn_name", "bus", "carrier", "e_nom", "e_nom_extendable", "v_nom", + "geometry" + ], + "transformers_gdf": [ + "scn_name", "bus0", "bus1", "x", "r", "s_nom", "s_nom_extendable", + "geometry" + ], + "lines_gdf": [ + "bus0", "bus1", "x", "r", "s_nom", "s_nom_extendable", "length", + "num_parallel", "geometry", "v_nom" + ], + } + if shape_files_path: + for k, v in components_dict.items(): + shp_filename = os.path.join(shape_files_path, f"{k}.shp") + v.loc[:, save_cols[k]].to_file(shp_filename) + + return components_dict From 1b5ea16f419d66dfc879533ede2c39f58db08300 Mon Sep 17 00:00:00 2001 From: birgits Date: Tue, 20 Aug 2024 11:44:39 +0200 Subject: [PATCH 10/22] Apply black --- etrago/tools/utilities.py | 66 +++++++++++++++++++++++++++++---------- 1 file changed, 50 insertions(+), 16 deletions(-) diff --git a/etrago/tools/utilities.py b/etrago/tools/utilities.py index 7b292586..d539dcac 100755 --- a/etrago/tools/utilities.py +++ b/etrago/tools/utilities.py @@ -3028,7 +3028,9 @@ def export_to_shapefile(pypsa_network, shape_files_path=None, srid=4326): components_dict[f"{component}_gdf"] = gpd.GeoDataFrame( attr.merge( - buses_gdf[["geometry", "v_nom"]], left_on=left_on, right_index=True + buses_gdf[["geometry", "v_nom"]], + left_on=left_on, + right_index=True, ), crs=f"EPSG:{srid}", ) @@ -3042,16 +3044,19 @@ def export_to_shapefile(pypsa_network, shape_files_path=None, srid=4326): lines_df = lines_df.drop(columns=["geom"]) lines_gdf = lines_df.merge( - buses_gdf[["geometry", "v_nom"]].rename(columns={"geometry": "geom_0"}), - left_on="bus0", right_index=True + buses_gdf[["geometry", "v_nom"]].rename( + columns={"geometry": "geom_0"} + ), + left_on="bus0", + right_index=True, ) lines_gdf = lines_gdf.merge( buses_gdf[["geometry"]].rename(columns={"geometry": "geom_1"}), - left_on="bus1", right_index=True + left_on="bus1", + right_index=True, ) lines_gdf["geometry"] = lines_gdf.apply( - lambda _: LineString([_["geom_0"], _["geom_1"]]), - axis=1 + lambda _: LineString([_["geom_0"], _["geom_1"]]), axis=1 ) lines_gdf = gpd.GeoDataFrame(lines_gdf, crs=f"EPSG:{srid}") components_dict["lines_gdf"] = lines_gdf @@ -3059,25 +3064,54 @@ def export_to_shapefile(pypsa_network, shape_files_path=None, srid=4326): save_cols = { "buses_gdf": ["scn_name", "v_nom", "carrier", "country", "geometry"], "generators_gdf": [ - "scn_name", "bus", "carrier", "p_nom", "p_nom_extendable", "v_nom", - "geometry" + "scn_name", + "bus", + "carrier", + "p_nom", + "p_nom_extendable", + "v_nom", + "geometry", ], "loads_gdf": ["scn_name", "bus", "carrier", "v_nom", "geometry"], "storage_units_gdf": [ - "scn_name", "bus", "carrier", "p_nom", "p_nom_extendable", "v_nom", - "geometry" + "scn_name", + "bus", + "carrier", + "p_nom", + "p_nom_extendable", + "v_nom", + "geometry", ], "stores_gdf": [ - "scn_name", "bus", "carrier", "e_nom", "e_nom_extendable", "v_nom", - "geometry" + "scn_name", + "bus", + "carrier", + "e_nom", + "e_nom_extendable", + "v_nom", + "geometry", ], "transformers_gdf": [ - "scn_name", "bus0", "bus1", "x", "r", "s_nom", "s_nom_extendable", - "geometry" + "scn_name", + "bus0", + "bus1", + "x", + "r", + "s_nom", + "s_nom_extendable", + "geometry", ], "lines_gdf": [ - "bus0", "bus1", "x", "r", "s_nom", "s_nom_extendable", "length", - "num_parallel", "geometry", "v_nom" + "bus0", + "bus1", + "x", + "r", + "s_nom", + "s_nom_extendable", + "length", + "num_parallel", + "geometry", + "v_nom", ], } if shape_files_path: From 6cb6c7c302469e0251a6e1b7eb30efde50241acb Mon Sep 17 00:00:00 2001 From: birgits Date: Tue, 20 Aug 2024 11:45:53 +0200 Subject: [PATCH 11/22] Apply isort --- etrago/tools/utilities.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etrago/tools/utilities.py b/etrago/tools/utilities.py index d539dcac..5b9d4f69 100755 --- a/etrago/tools/utilities.py +++ b/etrago/tools/utilities.py @@ -36,7 +36,7 @@ import sqlalchemy.exc if "READTHEDOCS" not in os.environ: - from shapely.geometry import Point, LineString + from shapely.geometry import LineString, Point import geopandas as gpd from etrago.tools import db From 22f8af6ee863e990860ff196241498df3296ed6e Mon Sep 17 00:00:00 2001 From: ClaraBuettner Date: Tue, 3 Sep 2024 15:52:05 +0200 Subject: [PATCH 12/22] Apply black --- etrago/tools/utilities.py | 1 - 1 file changed, 1 deletion(-) diff --git a/etrago/tools/utilities.py b/etrago/tools/utilities.py index 7f9c4fce..b5f73f92 100755 --- a/etrago/tools/utilities.py +++ b/etrago/tools/utilities.py @@ -2989,7 +2989,6 @@ def manual_fixes_datamodel(etrago): ) - def export_to_shapefile(pypsa_network, shape_files_path=None, srid=4326): """ Translates all component DataFrames within the pypsa network From 94532fc4dbfd8312e0a46c535e69d5a287e65e23 Mon Sep 17 00:00:00 2001 From: CarlosEpia Date: Sat, 12 Oct 2024 10:52:23 +0200 Subject: [PATCH 13/22] rename functions in electrical clustering strategies --- etrago/cluster/spatial.py | 74 +++++++++++++++++++-------------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/etrago/cluster/spatial.py b/etrago/cluster/spatial.py index 9f782c1d..54e4a1e1 100755 --- a/etrago/cluster/spatial.py +++ b/etrago/cluster/spatial.py @@ -121,38 +121,38 @@ def strategies_lines(): def strategies_one_ports(): return { "StorageUnit": { - "marginal_cost": np.mean, - "capital_cost": np.mean, - "efficiency_dispatch": np.mean, - "standing_loss": np.mean, - "efficiency_store": np.mean, - "p_min_pu": np.min, + "marginal_cost": "mean", + "capital_cost": "mean", + "efficiency_dispatch": "mean", + "standing_loss": "mean", + "efficiency_store": "mean", + "p_min_pu": "min", "p_nom_extendable": ext_storage, "p_nom_max": sum_with_inf, }, "Store": { - "marginal_cost": np.mean, - "capital_cost": np.mean, - "standing_loss": np.mean, - "e_nom": np.sum, - "e_nom_min": np.sum, + "marginal_cost": "mean", + "capital_cost": "mean", + "standing_loss": "mean", + "e_nom": "sum", + "e_nom_min": "sum", "e_nom_max": sum_with_inf, - "e_initial": np.sum, - "e_min_pu": np.mean, - "e_max_pu": np.mean, + "e_initial": "sum", + "e_min_pu": "mean", + "e_max_pu": "mean", }, } def strategies_generators(): return { - "p_nom_min": np.min, + "p_nom_min": "min", "p_nom_max": sum_with_inf, - "weight": np.sum, - "p_nom": np.sum, - "p_nom_opt": np.sum, - "marginal_cost": np.mean, - "capital_cost": np.mean, + "weight": "sum", + "p_nom": "sum", + "p_nom_opt": "sum", + "marginal_cost": "mean", + "capital_cost": "mean", "e_nom_max": sum_with_inf, } @@ -163,30 +163,30 @@ def strategies_links(): "bus0": _make_consense_links, "bus1": _make_consense_links, "carrier": _make_consense_links, - "p_nom": np.sum, + "p_nom": "sum", "p_nom_extendable": _make_consense_links, "p_nom_max": sum_with_inf, - "capital_cost": np.mean, - "length": np.mean, + "capital_cost": "mean", + "length": "mean", "geom": nan_links, "topo": nan_links, "type": nan_links, - "efficiency": np.mean, - "p_nom_min": np.sum, - "p_set": np.mean, - "p_min_pu": np.min, - "p_max_pu": np.max, - "marginal_cost": np.mean, + "efficiency": "mean", + "p_nom_min": "sum", + "p_set": "mean", + "p_min_pu": "min", + "p_max_pu": "max", + "marginal_cost": "mean", "terrain_factor": _make_consense_links, - "p_nom_opt": np.mean, + "p_nom_opt": "mean", "country": nan_links, - "build_year": np.mean, - "lifetime": np.mean, - "min_up_time": np.mean, - "min_down_time": np.mean, - "up_time_before": np.mean, - "down_time_before": np.mean, - "committable": np.all, + "build_year": "mean", + "lifetime": "mean", + "min_up_time": "mean", + "min_down_time": "mean", + "up_time_before": "mean", + "down_time_before": "mean", + "committable": "all", } From 7da69d10dd99b9c99a81d852523e1bcbbd9d613f Mon Sep 17 00:00:00 2001 From: CarlosEpia Date: Sat, 12 Oct 2024 10:53:20 +0200 Subject: [PATCH 14/22] deal with axis=1 warning in groupby --- etrago/cluster/spatial.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/etrago/cluster/spatial.py b/etrago/cluster/spatial.py index 54e4a1e1..17479ffd 100755 --- a/etrago/cluster/spatial.py +++ b/etrago/cluster/spatial.py @@ -255,7 +255,7 @@ def arrange_dc_bus0_bus1(network): strategies.pop("topo") strategies.pop("geom") - new_df = links.groupby(grouper, axis=0).agg(strategies) + new_df = links.groupby(grouper).agg(strategies) new_df.index = flatten_multiindex(new_df.index).rename("name") new_df = pd.concat( [new_df, network.links.loc[~links_agg_b]], axis=0, sort=False @@ -275,7 +275,7 @@ def arrange_dc_bus0_bus1(network): df_agg = df_agg.multiply( weighting.loc[df_agg.columns], axis=1 ) - pnl_df = df_agg.groupby(grouper, axis=1).sum() + pnl_df = df_agg.T.groupby(grouper).sum().T pnl_df.columns = flatten_multiindex(pnl_df.columns).rename( "name" ) From 26cbf1f1d022cb0878c502d5b40e156414a3ec1e Mon Sep 17 00:00:00 2001 From: CarlosEpia Date: Sat, 12 Oct 2024 10:54:18 +0200 Subject: [PATCH 15/22] deal with features names warning in kmeans --- etrago/cluster/spatial.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etrago/cluster/spatial.py b/etrago/cluster/spatial.py index 17479ffd..e7cf8c19 100755 --- a/etrago/cluster/spatial.py +++ b/etrago/cluster/spatial.py @@ -759,7 +759,7 @@ def kmedoids_dijkstra_clustering( kmeans.fit(points) busmap = pd.Series( - data=kmeans.predict(buses.loc[buses_i, ["x", "y"]]), + data=kmeans.predict(buses.loc[buses_i, ["x", "y"]].values), index=buses_i, dtype=object, ) From 1f66b0e95d9bea7bf8ad7b25cee7aa5f66c301fb Mon Sep 17 00:00:00 2001 From: CarlosEpia Date: Sat, 12 Oct 2024 17:30:12 +0200 Subject: [PATCH 16/22] rename functions in gas clustering strategies --- etrago/cluster/gas.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/etrago/cluster/gas.py b/etrago/cluster/gas.py index b31f4e1e..e59d9c8b 100644 --- a/etrago/cluster/gas.py +++ b/etrago/cluster/gas.py @@ -417,20 +417,20 @@ def gas_postprocessing(etrago, busmap, medoid_idx=None): }, one_port_strategies={ "Generator": { - "marginal_cost": np.mean, - "capital_cost": np.mean, - "p_nom_max": np.sum, - "p_nom_min": np.sum, - "e_nom_max": np.sum, + "marginal_cost": "mean", + "capital_cost": "mean", + "p_nom_max": "sum", + "p_nom_min": "sum", + "e_nom_max": "sum", }, "Store": { - "marginal_cost": np.mean, - "capital_cost": np.mean, - "e_nom": np.sum, + "marginal_cost": "mean", + "capital_cost": "mean", + "e_nom": "sum", "e_nom_max": sum_with_inf, }, "Load": { - "p_set": np.sum, + "p_set": "sum", }, }, ) From a5468e2f44f158baad107380eec0549787c4ead8 Mon Sep 17 00:00:00 2001 From: CarlosEpia Date: Wed, 16 Oct 2024 10:55:53 +0200 Subject: [PATCH 17/22] solve geopandas deprecation warning about naturalearth_lowres --- etrago/tools/shapes_europe/shapes_europe.cpg | 1 + etrago/tools/shapes_europe/shapes_europe.dbf | Bin 0 -> 3225 bytes etrago/tools/shapes_europe/shapes_europe.prj | 1 + etrago/tools/shapes_europe/shapes_europe.shp | Bin 0 -> 34664 bytes etrago/tools/shapes_europe/shapes_europe.shx | Bin 0 -> 412 bytes etrago/tools/utilities.py | 8 +++++--- 6 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 etrago/tools/shapes_europe/shapes_europe.cpg create mode 100644 etrago/tools/shapes_europe/shapes_europe.dbf create mode 100644 etrago/tools/shapes_europe/shapes_europe.prj create mode 100644 etrago/tools/shapes_europe/shapes_europe.shp create mode 100644 etrago/tools/shapes_europe/shapes_europe.shx diff --git a/etrago/tools/shapes_europe/shapes_europe.cpg b/etrago/tools/shapes_europe/shapes_europe.cpg new file mode 100644 index 00000000..cd89cb97 --- /dev/null +++ b/etrago/tools/shapes_europe/shapes_europe.cpg @@ -0,0 +1 @@ +ISO-8859-1 \ No newline at end of file diff --git a/etrago/tools/shapes_europe/shapes_europe.dbf b/etrago/tools/shapes_europe/shapes_europe.dbf new file mode 100644 index 0000000000000000000000000000000000000000..1a2f3f2f8e26dab864ac6a4d8c014c68a34ec302 GIT binary patch literal 3225 zcmb`J&1%Ci5QGiA6$(A~q+4%&ha_!&$PZ~u9$;fHwy>-%E6Hg?AHFi_sXb)kIJQ^Cpw!-r#?+95l~{h{4FIEM&`R@`LhgW7BnSMGjd^9?lXf`KM{gt7 zW^H{_3&K6C3f#le$-u~jom-Ec@>n5tz_^)RxN3nsGnFuQaP;<)_40DFfASw}Y|WM` ft})xMWIZ7jo2~fBo*R{$#a;nx2{NEy8Ts@B9?0Pd literal 0 HcmV?d00001 diff --git a/etrago/tools/shapes_europe/shapes_europe.prj b/etrago/tools/shapes_europe/shapes_europe.prj new file mode 100644 index 00000000..f45cbadf --- /dev/null +++ b/etrago/tools/shapes_europe/shapes_europe.prj @@ -0,0 +1 @@ +GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]] \ No newline at end of file diff --git a/etrago/tools/shapes_europe/shapes_europe.shp b/etrago/tools/shapes_europe/shapes_europe.shp new file mode 100644 index 0000000000000000000000000000000000000000..443b060ef857ee96c30f96fafdf78c54752391b2 GIT binary patch literal 34664 zcmaI83piBY7e72vk#1B_P1Jsh}$X`@n#FCd2~qB+Sw8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$TeF%}$S#j$>X$}p-UW%P{2u&@{tPOSR#lmmce8pgyh zdd37>nGNGnFkS`YSuoxO<6$sfhJ6|STIvCG`@je(2gz-XtwI;?4eyDku ziyVU=@`JKK(^m+HaORoXZ=o%ftSr%;Bp^i}LV1(z0q-*`E7DcDzXSYm!ca(b9VZ}< zBc~;vhj@%A$?-p3(*=+#Wi6D#13&G%R(l;q0r}{5$Ry-E#AoJaJa0S$_#LLs;Q?8^ z4~X0Z_Mvqqi`il^a4hzd#o03b#I7?j1{Y&=*=t!0FUIX*Tpz~$VO$`_=V3e<`|d2> z4CB!-Ud>SZZvK(;(;(+1)IIBfxY5GD-s%Cjj(oOTdQ9G(P#-8f}#&Tn< zH`YVkFSy_QT%iCitV>JW&;8vG*l|BdtA6%`9eK^vtDFIT?`oG*-_+RsTgP_^w3#}0 zN9~A+slyfs<4Y~`3!i8^qPD+bY(x}{r`ciowjO|Ig>sycaS;Dx3U!#+k&jTO_hvG* znR4x!*$3LDQ@cbe3UqJs2 J{9nQH`yZ$dd&K|% literal 0 HcmV?d00001 diff --git a/etrago/tools/shapes_europe/shapes_europe.shx b/etrago/tools/shapes_europe/shapes_europe.shx new file mode 100644 index 0000000000000000000000000000000000000000..be514f84f944489a29d1f6b42929b6a1704e8cab GIT binary patch literal 412 zcmaKnJxD@P97oT4QA4x^ks)MBT4HJz6n)_3(XNA#YYChHz*Q zC%2*@LL8)_slh269700+$;B=lj{c62=|G{GxfP zRWHVJc{42ehiRCs>2|>VfT@Of2mueA0?gcsJ_P4MOPP&W58aCf=Dx&f2oK(>8R5SC z1Qt%^6^JCnXR&8J`k;IpmTu(V5WAAUK>R@7f@LE=g2bcsFtn zNE@*Nt6lVSSkrE|3G3?N9X7Pz5jQ8~RZ(x@4z`XJFTnPjowK8UCk2^Bt08!{{nb(J_7&% literal 0 HcmV?d00001 diff --git a/etrago/tools/utilities.py b/etrago/tools/utilities.py index b5f73f92..8d3436af 100755 --- a/etrago/tools/utilities.py +++ b/etrago/tools/utilities.py @@ -24,6 +24,7 @@ from collections.abc import Mapping from copy import deepcopy +from pathlib import Path import json import logging import math @@ -287,9 +288,10 @@ def buses_by_country(self, apply_on="grid_model"): con = self.engine germany_sh = gpd.read_postgis(query, con, geom_col="geometry") - path = gpd.datasets.get_path("naturalearth_lowres") - shapes = gpd.read_file(path) - shapes = shapes[shapes.name.isin([*countries])].set_index(keys="name") + # read Europe borders. Original data downloaded from naturalearthdata.com/ + # under Public Domain license + path = Path(".") / "tools" / "shapes_europe" + shapes = gpd.read_file(path).set_index("name") # Use Germany borders from egon-data if not using the SH test case if len(germany_sh.gen.unique()) > 1: From fc5c4a81c91a71b3a24ab43d780ac0e203ff566d Mon Sep 17 00:00:00 2001 From: CarlosEpia Date: Tue, 22 Oct 2024 10:58:54 +0200 Subject: [PATCH 18/22] delete shape_files from repository --- etrago/tools/shapes_europe/shapes_europe.cpg | 1 - etrago/tools/shapes_europe/shapes_europe.dbf | Bin 3225 -> 0 bytes etrago/tools/shapes_europe/shapes_europe.prj | 1 - etrago/tools/shapes_europe/shapes_europe.shp | Bin 34664 -> 0 bytes etrago/tools/shapes_europe/shapes_europe.shx | Bin 412 -> 0 bytes 5 files changed, 2 deletions(-) delete mode 100644 etrago/tools/shapes_europe/shapes_europe.cpg delete mode 100644 etrago/tools/shapes_europe/shapes_europe.dbf delete mode 100644 etrago/tools/shapes_europe/shapes_europe.prj delete mode 100644 etrago/tools/shapes_europe/shapes_europe.shp delete mode 100644 etrago/tools/shapes_europe/shapes_europe.shx diff --git a/etrago/tools/shapes_europe/shapes_europe.cpg b/etrago/tools/shapes_europe/shapes_europe.cpg deleted file mode 100644 index cd89cb97..00000000 --- a/etrago/tools/shapes_europe/shapes_europe.cpg +++ /dev/null @@ -1 +0,0 @@ -ISO-8859-1 \ No newline at end of file diff --git a/etrago/tools/shapes_europe/shapes_europe.dbf b/etrago/tools/shapes_europe/shapes_europe.dbf deleted file mode 100644 index 1a2f3f2f8e26dab864ac6a4d8c014c68a34ec302..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3225 zcmb`J&1%Ci5QGiA6$(A~q+4%&ha_!&$PZ~u9$;fHwy>-%E6Hg?AHFi_sXb)kIJQ^Cpw!-r#?+95l~{h{4FIEM&`R@`LhgW7BnSMGjd^9?lXf`KM{gt7 zW^H{_3&K6C3f#le$-u~jom-Ec@>n5tz_^)RxN3nsGnFuQaP;<)_40DFfASw}Y|WM` ft})xMWIZ7jo2~fBo*R{$#a;nx2{NEy8Ts@B9?0Pd diff --git a/etrago/tools/shapes_europe/shapes_europe.prj b/etrago/tools/shapes_europe/shapes_europe.prj deleted file mode 100644 index f45cbadf..00000000 --- a/etrago/tools/shapes_europe/shapes_europe.prj +++ /dev/null @@ -1 +0,0 @@ -GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]] \ No newline at end of file diff --git a/etrago/tools/shapes_europe/shapes_europe.shp b/etrago/tools/shapes_europe/shapes_europe.shp deleted file mode 100644 index 443b060ef857ee96c30f96fafdf78c54752391b2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 34664 zcmaI83piBY7e72vk#1B_P1Jsh}$X`@n#FCd2~qB+Sw8^+<%+>w6TEkuRMd7o>+p5 z;C9KF7ITniX!QwHSVBR_TcGYShbGU?i}f@ra8wOF6FyMj@YCbVxb4|q+PvKMx4WM7 z4ZkfxKAik+V_? zweQ>f0>^#bD>iM-7YgLq!eY-J3+Uf8xah@Pa|mXpim8=ZfUU-$gd3Pczuw2^O%w}| zdU!oW#?2f`US{{G{xAm@df#V$OLKtvRhAFC&7t6H`2Ob}<`DDfcVVQOIV5L0*QuSu z{#-Y*1i~r67EYplEHH4BC#%50CoM+#b}_-xey^z7LvYj*BAP|=FMTxwPNvtn3JEI2OL~7<*NX2?lxR8lP$4zPlkO}) z0caF@?V3%6{sqxCt^7!z%vOz|dM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G(P#-8f}#&Tn< zH`YVkFSy_QT%iCitV>JW&;8vG*l|BdtA6%`9eK^vtDFIT?`oG*-_+RsTgP_^w3#}0 zN9~A+slyfs<4Y~`3!i8^qPD+bY(x}{r`ciowjO|Ig>sycaS;Dx3U!#+k&jTO_hvG* znR4x!*$3LDQ@cbe3UqJs2 J{9nQH`yZ$dd&K|% diff --git a/etrago/tools/shapes_europe/shapes_europe.shx b/etrago/tools/shapes_europe/shapes_europe.shx deleted file mode 100644 index be514f84f944489a29d1f6b42929b6a1704e8cab..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 412 zcmaKnJxD@P97oT4QA4x^ks)MBT4HJz6n)_3(XNA#YYChHz*Q zC%2*@LL8)_slh269700+$;B=lj{c62=|G{GxfP zRWHVJc{42ehiRCs>2|>VfT@Of2mueA0?gcsJ_P4MOPP&W58aCf=Dx&f2oK(>8R5SC z1Qt%^6^JCnXR&8J`k;IpmTu(V5WAAUK>R@7f@LE=g2bcsFtn zNE@*Nt6lVSSkrE|3G3?N9X7Pz5jQ8~RZ(x@4z`XJFTnPjowK8UCk2^Bt08!{{nb(J_7&% From b85dcd77b0af16a1d3658c5236330e5a8146ebe2 Mon Sep 17 00:00:00 2001 From: CarlosEpia Date: Tue, 22 Oct 2024 11:00:52 +0200 Subject: [PATCH 19/22] download shape files when not available --- etrago/tools/utilities.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/etrago/tools/utilities.py b/etrago/tools/utilities.py index 8d3436af..b8dc8f41 100755 --- a/etrago/tools/utilities.py +++ b/etrago/tools/utilities.py @@ -25,10 +25,12 @@ from collections.abc import Mapping from copy import deepcopy from pathlib import Path +from urllib.request import urlretrieve import json import logging import math import os +import zipfile from pyomo.environ import Constraint, PositiveReals, Var import numpy as np @@ -290,8 +292,22 @@ def buses_by_country(self, apply_on="grid_model"): # read Europe borders. Original data downloaded from naturalearthdata.com/ # under Public Domain license - path = Path(".") / "tools" / "shapes_europe" - shapes = gpd.read_file(path).set_index("name") + path_countries = Path(".") / "tools" / "shapes_europe" + + if not os.path.exists(path_countries): + path_countries.mkdir(exist_ok=True, parents=True) + url_countries = "https://naciscdn.org/naturalearth/110m/cultural/ne_110m_admin_0_countries.zip" + urlretrieve(url_countries, path_countries / "shape_countries.zip") + with zipfile.ZipFile( + path_countries / "shape_countries.zip", "r" + ) as zip_ref: + zip_ref.extractall(path_countries) + + shapes = ( + gpd.read_file(path_countries) + .rename(columns={"NAME": "name"}) + .set_index("name") + ) # Use Germany borders from egon-data if not using the SH test case if len(germany_sh.gen.unique()) > 1: From 712eda0ba489fc31c33dcd7f5cf4449abffa1609 Mon Sep 17 00:00:00 2001 From: CarlosEpia Date: Wed, 23 Oct 2024 14:06:26 +0200 Subject: [PATCH 20/22] change path for shape-files --- etrago/tools/utilities.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/etrago/tools/utilities.py b/etrago/tools/utilities.py index b8dc8f41..0514c35d 100755 --- a/etrago/tools/utilities.py +++ b/etrago/tools/utilities.py @@ -292,11 +292,14 @@ def buses_by_country(self, apply_on="grid_model"): # read Europe borders. Original data downloaded from naturalearthdata.com/ # under Public Domain license - path_countries = Path(".") / "tools" / "shapes_europe" + path_countries = Path(".") / "data" / "shapes_europe" if not os.path.exists(path_countries): path_countries.mkdir(exist_ok=True, parents=True) - url_countries = "https://naciscdn.org/naturalearth/110m/cultural/ne_110m_admin_0_countries.zip" + url_countries = ( + "https://naciscdn.org/naturalearth/110m/cultural/" + + "ne_110m_admin_0_countries.zip" + ) urlretrieve(url_countries, path_countries / "shape_countries.zip") with zipfile.ZipFile( path_countries / "shape_countries.zip", "r" From 8ac9acbde29590953708398a6c40d3e4b692889c Mon Sep 17 00:00:00 2001 From: ClaraBuettner Date: Wed, 23 Oct 2024 15:20:59 +0200 Subject: [PATCH 21/22] Do not overwrite clustering ans busmap object when creating the market_model --- etrago/execute/market_optimization.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/etrago/execute/market_optimization.py b/etrago/execute/market_optimization.py index 6d8eb5b1..38fcd56a 100644 --- a/etrago/execute/market_optimization.py +++ b/etrago/execute/market_optimization.py @@ -301,7 +301,7 @@ def build_market_model(self): logger.info("Start market zone specifc clustering") - self.clustering, busmap = postprocessing( + clustering, busmap = postprocessing( self, busmap, busmap_foreign, @@ -311,9 +311,8 @@ def build_market_model(self): apply_on="market_model", ) - self.update_busmap(busmap) - net = self.clustering.network + net = clustering.network # links_col = net.links.columns ac = net.lines[net.lines.carrier == "AC"] str1 = "transshipment_" From b0ad7be42a2bc99883080379c01e92ba391ffcc0 Mon Sep 17 00:00:00 2001 From: ClaraBuettner Date: Wed, 23 Oct 2024 15:23:24 +0200 Subject: [PATCH 22/22] Apply black --- etrago/execute/market_optimization.py | 1 - 1 file changed, 1 deletion(-) diff --git a/etrago/execute/market_optimization.py b/etrago/execute/market_optimization.py index 38fcd56a..47436a7e 100644 --- a/etrago/execute/market_optimization.py +++ b/etrago/execute/market_optimization.py @@ -311,7 +311,6 @@ def build_market_model(self): apply_on="market_model", ) - net = clustering.network # links_col = net.links.columns ac = net.lines[net.lines.carrier == "AC"]