Skip to content

Commit 123cb7a

Browse files
committed
Merge branch 'bug-conduit-check' into conduit-filter-doc
2 parents 0ff0cb1 + 2d6c0fd commit 123cb7a

2 files changed

Lines changed: 18 additions & 3 deletions

File tree

‎ymmsl/v0_2/tests/test_timeline_resolver.py‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,3 +163,16 @@ def test_interact_time_bridge_matching(timelines_configuration: Configuration) -
163163

164164
assert model.components[Ref("A")].timeline == Timeline("A")
165165
assert model.components[Ref("bridge")].timeline == Timeline("bridge")
166+
167+
168+
def test_matching_timelines_check_all_conduits(
169+
timelines_configuration: Configuration,
170+
) -> None:
171+
model = timelines_configuration.models[Ref("interact_time_bridge")]
172+
resolve_timelines(model)
173+
174+
# The first conduit connects matching timelines, the next one should still be
175+
# checked
176+
model.conduits[-1].filters.append(ConduitFilter.LAST)
177+
with pytest.raises(ConduitTimelineError, match="remove a reducer"):
178+
resolve_timelines(model)

‎ymmsl/v0_2/timeline_resolver.py‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -364,9 +364,11 @@ def check_consistent(self) -> None:
364364
filtered_tl1 = timeline1[:-num_reducers] if num_reducers else timeline1
365365
filtered_tl2 = timeline2[:-num_repeaters] if num_repeaters else timeline2
366366
if self._model.matching_timelines:
367-
for mt in self._model.matching_timelines:
368-
if filtered_tl1 in mt and filtered_tl2 in mt:
369-
return
367+
if any(
368+
filtered_tl1 in mt and filtered_tl2 in mt
369+
for mt in self._model.matching_timelines
370+
):
371+
continue
370372

371373
common_idx = len(timeline1) - num_reducers
372374
self._check_consistent_equal_length(

0 commit comments

Comments
 (0)