Skip to content

Commit cb0a84f

Browse files
committed
refac: change has_volume_limit to bool
1 parent 41b387e commit cb0a84f

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

scripts/cba/prepare_rolling_horizon.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ def disable_volume_limits(n: pypsa.Network):
130130
for c in n.components[{"Generator", "Link"}]:
131131
has_e_sum_min = isfinite(c.static.get("e_sum_min", []))
132132
if has_e_sum_min.any():
133-
c.static["has_volume_limit"] = 0
134-
c.static.loc[has_e_sum_min, "has_volume_limit"] = 1
133+
c.static["has_volume_limit"] = False
134+
c.static.loc[has_e_sum_min, "has_volume_limit"] = True
135135
c.static.loc[has_e_sum_min, "e_sum_min"] = -inf
136136
c.static.loc[has_e_sum_min, "e_sum_max"] = inf
137137

scripts/cba/solve_cba_network.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,7 @@ def get_components_with_volume_limits(
7777
if "has_volume_limit" not in static.columns:
7878
return pd.Index([])
7979

80-
return static.index[
81-
static["carrier"].isin(carriers) & static["has_volume_limit"].eq(1)
82-
]
80+
return static.index[static["carrier"].isin(carriers) & static["has_volume_limit"]]
8381

8482

8583
def extra_functionality(

0 commit comments

Comments
 (0)