From 347921fdee5b3e8d0f553f81bb5220a8618caa84 Mon Sep 17 00:00:00 2001 From: Ronnie Dutta <61982285+MetRonnie@users.noreply.github.com> Date: Thu, 15 Aug 2024 15:58:12 +0100 Subject: [PATCH] Remove `c` char from prereq API dump --- cylc/flow/prerequisite.py | 5 ++--- tests/flakyfunctional/cylc-show/00-simple.t | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/cylc/flow/prerequisite.py b/cylc/flow/prerequisite.py index b388934e2de..50d2280a204 100644 --- a/cylc/flow/prerequisite.py +++ b/cylc/flow/prerequisite.py @@ -16,7 +16,6 @@ """Functionality for expressing and evaluating logical triggers.""" -import math import re from typing import Iterable, Set, TYPE_CHECKING @@ -232,11 +231,11 @@ def api_dump(self): for s_msg in self.satisfied ) conds = [] - num_length = math.ceil(len(self.satisfied) / 10) + num_length = len(str(len(self.satisfied))) for ind, message_tuple in enumerate(sorted(self.satisfied)): point, name = message_tuple[0:2] t_id = quick_relative_detokenise(point, name) - char = 'c%.{0}d'.format(num_length) % ind + char = str(ind).zfill(num_length) c_msg = self.MESSAGE_TEMPLATE % message_tuple c_val = self.satisfied[message_tuple] c_bool = bool(c_val) diff --git a/tests/flakyfunctional/cylc-show/00-simple.t b/tests/flakyfunctional/cylc-show/00-simple.t index 8e6b9156924..f96a1129268 100644 --- a/tests/flakyfunctional/cylc-show/00-simple.t +++ b/tests/flakyfunctional/cylc-show/00-simple.t @@ -112,10 +112,10 @@ cmp_json "${TEST_NAME}-taskinstance" "${TEST_NAME}-taskinstance" \ "runtime": {"completion": "(started and succeeded)"}, "prerequisites": [ { - "expression": "c0", + "expression": "0", "conditions": [ { - "exprAlias": "c0", + "exprAlias": "0", "taskId": "20141106T0900Z/bar", "reqState": "succeeded", "message": "satisfied naturally",