Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions ymmsl/v0_2/tests/test_timeline_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,3 +163,16 @@ def test_interact_time_bridge_matching(timelines_configuration: Configuration) -

assert model.components[Ref("A")].timeline == Timeline("A")
assert model.components[Ref("bridge")].timeline == Timeline("bridge")


def test_matching_timelines_check_all_conduits(
timelines_configuration: Configuration,
) -> None:
model = timelines_configuration.models[Ref("interact_time_bridge")]
resolve_timelines(model)

# The first conduit connects matching timelines, the next one should still be
# checked
model.conduits[-1].filters.append(ConduitFilter.LAST)
with pytest.raises(ConduitTimelineError, match="remove a reducer"):
resolve_timelines(model)
8 changes: 5 additions & 3 deletions ymmsl/v0_2/timeline_resolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,9 +364,11 @@ def check_consistent(self) -> None:
filtered_tl1 = timeline1[:-num_reducers] if num_reducers else timeline1
filtered_tl2 = timeline2[:-num_repeaters] if num_repeaters else timeline2
if self._model.matching_timelines:
for mt in self._model.matching_timelines:
if filtered_tl1 in mt and filtered_tl2 in mt:
return
if any(
filtered_tl1 in mt and filtered_tl2 in mt
for mt in self._model.matching_timelines
):
continue

common_idx = len(timeline1) - num_reducers
self._check_consistent_equal_length(
Expand Down
Loading