From cc9d577a7fcd021dc53a289b8edaa654307d9e5a Mon Sep 17 00:00:00 2001 From: ClaraBuettner Date: Thu, 8 Aug 2024 11:24:34 +0200 Subject: [PATCH 1/6] 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 2/6] 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 3/6] 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 4/6] 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 5/6] 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 22f8af6ee863e990860ff196241498df3296ed6e Mon Sep 17 00:00:00 2001 From: ClaraBuettner Date: Tue, 3 Sep 2024 15:52:05 +0200 Subject: [PATCH 6/6] 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