diff --git a/cylc/flow/config.py b/cylc/flow/config.py index 5eaac921bee..1cd9f91cd4e 100644 --- a/cylc/flow/config.py +++ b/cylc/flow/config.py @@ -2075,12 +2075,12 @@ def load_graph(self): traceback.print_exc() msg = ( f"Cannot process recurrence {section}" - f" (initial cycle point={icp}" - f" (final cycle point={fcp}" + f" (initial cycle point={icp})" + f" (final cycle point={fcp})" ) if isinstance(exc, CylcError): msg += ' %s' % exc.args[0] - raise WorkflowConfigError(msg) + raise WorkflowConfigError(msg) else: self.nocycle_sequences.add(seq) else: diff --git a/cylc/flow/cycling/nocycle.py b/cylc/flow/cycling/nocycle.py index 05c2b184d96..67fa23f0552 100644 --- a/cylc/flow/cycling/nocycle.py +++ b/cylc/flow/cycling/nocycle.py @@ -31,10 +31,18 @@ NOCYCLE_PT_OMEGA ) +CYCLER_TYPE_NOCYCLE = "nocycle" +CYCLER_TYPE_SORT_KEY_NOCYCLE = 1 + class NocyclePoint(PointBase): """A string-valued point.""" + TYPE = CYCLER_TYPE_NOCYCLE + TYPE_SORT_KEY = CYCLER_TYPE_SORT_KEY_NOCYCLE + + __slots__ = ('value') + def __init__(self, value: str) -> None: if value not in [NOCYCLE_PT_ALPHA, NOCYCLE_PT_OMEGA]: raise ValueError(f"Illegal Nocycle value {value}") @@ -72,14 +80,6 @@ def sub(self, other): # NOT USED return None - def TYPE(self) -> str: - # NOT USED - return self.__class__.__name__ - - def TYPE_SORT_KEY(self) -> int: - # NOT USED - return 0 - class NocycleSequence(SequenceBase): """A single point sequence.""" diff --git a/cylc/flow/scripts/graph.py b/cylc/flow/scripts/graph.py index d9971135950..537c9de2290 100644 --- a/cylc/flow/scripts/graph.py +++ b/cylc/flow/scripts/graph.py @@ -43,10 +43,7 @@ from typing import Dict, List, Optional, TYPE_CHECKING, Tuple, Callable from cylc.flow.config import WorkflowConfig -from cylc.flow.cycling.nocycle import ( - NOCYCLE_PT_ALPHA, - NOCYCLE_PT_OMEGA -) +from cylc.flow.cycling.nocycle import NOCYCLE_PT_ALPHA from cylc.flow.exceptions import InputError, CylcError from cylc.flow.id import Tokens from cylc.flow.id_cli import parse_id @@ -101,28 +98,6 @@ def sort_integer_edge(id_): ) -def sort_datetime_node(id_): - """Return sort tokens for nodes with cyclepoints in datetime format. - - Lexicological sort, but tweaked for nocycle graphs. - - Example: - >>> sort_datetime_node('2001/foo') - ('foo', '2001') - >>> sort_datetime_node('alpha/foo') - ('foo', '0') - >>> sort_datetime_node('omega/foo') - ('foo', '9') - """ - tokens = Tokens(id_, relative=True) - if tokens['cycle'] == NOCYCLE_PT_ALPHA: - return (tokens['task'], '0') - elif tokens['cycle'] == NOCYCLE_PT_OMEGA: - return (tokens['task'], '9') - else: - return (tokens['task'], tokens['cycle']) - - def sort_datetime_edge(item): """Return sort tokens for edges with cyclepoints in ISO8601 format. @@ -186,7 +161,7 @@ def _get_graph_nodes_edges( edge_sort = sort_integer_edge else: # datetime sorting - node_sort = sort_datetime_node + node_sort = None edge_sort = sort_datetime_edge # get nodes diff --git a/tests/integration/utils/flow_tools.py b/tests/integration/utils/flow_tools.py index 8a880e211b9..24aa126c7f7 100644 --- a/tests/integration/utils/flow_tools.py +++ b/tests/integration/utils/flow_tools.py @@ -147,24 +147,16 @@ async def _run_flow( # context manager. # Need to shut down Scheduler, but time out in case something # goes wrong: - print("ONE") async with timeout(5): - print("TWAO") if task: - print("THREE") # ask the scheduler to shut down nicely, # let main loop handle it: schd._set_stop(StopMode.REQUEST_NOW_NOW) await task - print("FOUR") if schd.contact_data: - print("FIVE") async with timeout(5): # Scheduler still running... try more forceful tear down: await schd.shutdown(SchedulerStop("integration test teardown")) - print("SIX") if task: # Brute force cleanup if something went wrong: - print("SEVEN") task.cancel() - print("EIGHT")