Skip to content

Commit

Permalink
Fix comparisions to None and True
Browse files Browse the repository at this point in the history
  • Loading branch information
ClaraBuettner committed Sep 20, 2023
1 parent a6634a6 commit 55ba752
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion etrago/cluster/electrical.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,8 @@ def adjust_no_electric_network(etrago, busmap, cluster_met):
& (network2.links["carrier"] == map_carrier[carry])
].copy()
df["elec"] = df["bus0"].isin(busmap.keys())
df = df[df["elec"] is True]

df = df[df["elec"]]
if len(df) > 0:
bus_hv = df["bus0"][0]

Expand Down
2 changes: 1 addition & 1 deletion etrago/cluster/spatial.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def nan_links(x):


def ext_storage(x):
v = any(x[x is True])
v = any(x[x])
return v


Expand Down
4 changes: 2 additions & 2 deletions etrago/tools/execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ def import_gen_from_links(network):

# if foreign lines are DC, execute pf only on sub_network in Germany
if (args["foreign_lines"]["carrier"] == "DC") or (
(args["scn_extension"] is None)
(args["scn_extension"] is not None)
and ("BE_NO_NEP 2035" in args["scn_extension"])
):
foreign_bus, foreign_comp, foreign_series = drop_foreign_components(
Expand Down Expand Up @@ -883,7 +883,7 @@ def import_gen_from_links(network):
if (
(args["foreign_lines"]["carrier"] == "DC")
or (
(args["scn_extension"] is None)
(args["scn_extension"] is not None)
and ("BE_NO_NEP 2035" in args["scn_extension"])
)
) and etrago.args["pf_post_lopf"]["add_foreign_lopf"]:
Expand Down

0 comments on commit 55ba752

Please sign in to comment.