Skip to content

Commit

Permalink
Remove commented-out filter callbacks in wnd.py
Browse files Browse the repository at this point in the history
  • Loading branch information
tristantc committed Jan 23, 2025
1 parent e8ca299 commit caa3cff
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions gdplib/water_network/wnd.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,12 @@ def _streams_filter(m, val):
doc="MU to TU 1-1 port pairing",
initialize=m.inTU * m.TU,
filter=_streams_filter,
# filter=lambda _, x, y: re.findall(r'\d+', x) == re.findall(r'\d+', y),
)

m.TU_SU_streams = pyo.Set(
doc="TU to SU 1-1 port pairing",
initialize=m.TU * m.outTU,
filter=_streams_filter,
# filter=lambda _, x, y: re.findall(r'\d+', x) == re.findall(r'\d+', y),
)

m.TU_streams = pyo.Set(
Expand All @@ -181,7 +179,6 @@ def _streams_filter(m, val):
doc="Feed to FSU 1-1 port pairing",
initialize=m.feed * m.FSU,
filter=_streams_filter,
# filter=lambda _, x, y: re.findall(r'\d+', x) == re.findall(r'\d+', y),
)

m.streams = pyo.Set(
Expand Down Expand Up @@ -221,8 +218,7 @@ def _from_stream_filter(m, val):
within=m.streams,
initialize=m.streams,
filter=_from_stream_filter,
# filter=lambda _, x, y: x in m.splitters or (x, y) == ('dm', 'sink'),
) # Update the 'filter=' callback to match the signature (block, value).
)

def _to_stream_filter(m, val):
"""
Expand Down Expand Up @@ -252,7 +248,6 @@ def _to_stream_filter(m, val):
within=m.streams,
initialize=m.streams,
filter=_to_stream_filter,
# filter=lambda _, x, y: y in m.splitters or (x, y) in m.feed_streams,
)

# =============================================================================
Expand Down Expand Up @@ -590,8 +585,7 @@ def _unit_exists_streams_filter(unit_exists, val):
doc="Streams in active TU",
initialize=m.TU_streams,
filter=_unit_exists_streams_filter,
# filter=lambda _, x, y: x == unit or y == unit,
) # Update the 'filter=' callback to match the signature (block, value).
)

def _unit_exists_onetoone_filter(unit_exists, val):
"""
Expand Down Expand Up @@ -619,8 +613,6 @@ def _unit_exists_onetoone_filter(unit_exists, val):
doc="MU to TU 1-1 port pairing",
initialize=m.inTU * m.TU,
filter=_unit_exists_onetoone_filter,
# filter=lambda _, x, y: re.findall(r'\d+', x) == re.findall(r'\d+', y)
# and y == unit,
)

unit_exists.flow = pyo.Var(
Expand Down

0 comments on commit caa3cff

Please sign in to comment.