Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Features/#734 clean up applpy #751

Merged
merged 8 commits into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 1 addition & 29 deletions etrago/appl.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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()

Expand All @@ -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
Expand Down
14 changes: 14 additions & 0 deletions etrago/tools/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -2973,3 +2973,17 @@ 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,
)