Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

data store: add absolute graph edges #6103

Merged
merged 2 commits into from
Jul 19, 2024
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
2 changes: 2 additions & 0 deletions 6103.fix.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Absolute dependencies (dependencies on tasks in a specified cycle rather than at a specified offset) are now visible in the GUI beyond the specified cycle.

6 changes: 1 addition & 5 deletions cylc/flow/taskdef.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,7 @@ def generate_graph_parents(tdef, point, taskdefs):
# where (point -Px) does not land on a valid point for woo.
# TODO ideally validation would flag this as an error.
continue
is_abs = (trigger.offset_is_absolute or
trigger.offset_is_from_icp)
if is_abs and parent_point != point:
# If 'foo[^] => bar' only spawn off of '^'.
continue
is_abs = trigger.offset_is_absolute or trigger.offset_is_from_icp
graph_parents[seq].append((parent_name, parent_point, is_abs))

if tdef.sequential:
Expand Down
34 changes: 34 additions & 0 deletions tests/integration/test_data_store_mgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from typing import TYPE_CHECKING

from cylc.flow.data_store_mgr import (
EDGES,
FAMILY_PROXIES,
JOBS,
TASKS,
Expand Down Expand Up @@ -316,3 +317,36 @@ def test_delta_task_prerequisite(harness):
p.satisfied
for t in schd.data_store_mgr.updated[TASK_PROXIES].values()
for p in t.prerequisites})


async def test_absolute_graph_edges(flow, scheduler, start):
"""It should add absolute graph edges to the store.

See: https://github.com/cylc/cylc-flow/issues/5845
"""
runahead_cycles = 1
id_ = flow({
'scheduling': {
'initial cycle point': '1',
'cycling mode': 'integer',
'runahead limit': f'P{runahead_cycles}',
'graph': {
'R1': 'build',
'P1': 'build[^] => run',
},
},
})
schd = scheduler(id_)

async with start(schd):
await schd.update_data_structure()

assert {
(Tokens(edge.source).relative_id, Tokens(edge.target).relative_id)
for edge in schd.data_store_mgr.data[schd.id][EDGES].values()
} == {
('1/build', f'{cycle}/run')
# +1 for Python's range()
# +2 for Cylc's runahead
for cycle in range(1, runahead_cycles + 3)
}
Loading