Skip to content

Commit

Permalink
Add print statement when resitances are set automatically
Browse files Browse the repository at this point in the history
  • Loading branch information
ClaraBuettner committed Dec 1, 2023
1 parent 9daf55f commit 25de9e9
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions etrago/tools/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -2860,7 +2860,28 @@ def manual_fixes_datamodel(etrago):
] = 25

# Set r value if missing
if not etrago.network.lines.loc[etrago.network.lines.r == 0, "r"].empty:
logger.info(
f"""
There are {len(
etrago.network.lines.loc[etrago.network.lines.r == 0, "r"]
)} lines without a resistance (r) in the data model.
The resistance of these lines will be automatically set to 0.0001.
"""
)

etrago.network.lines.loc[etrago.network.lines.r == 0, "r"] = 0.0001

if not etrago.network.transformers.loc[
etrago.network.transformers.r == 0, "r"
].empty:
logger.info(
f"""There are {len(etrago.network.transformers.loc[
etrago.network.transformers.r == 0, "r"]
)} trafos without a resistance (r) in the data model.
The resistance of these trafos will be automatically set to 0.0001.
"""
)
etrago.network.transformers.loc[
etrago.network.transformers.r == 0, "r"
] = 0.0001
Expand Down

0 comments on commit 25de9e9

Please sign in to comment.