diff --git a/etrago/appl.py b/etrago/appl.py index baa99462..d5f74368 100644 --- a/etrago/appl.py +++ b/etrago/appl.py @@ -682,21 +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): - 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() @@ -705,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() @@ -735,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 diff --git a/etrago/tools/utilities.py b/etrago/tools/utilities.py index 5b9d4f69..b5f73f92 100755 --- a/etrago/tools/utilities.py +++ b/etrago/tools/utilities.py @@ -2974,6 +2974,20 @@ def manual_fixes_datamodel(etrago): 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, + ) + def export_to_shapefile(pypsa_network, shape_files_path=None, srid=4326): """