diff --git a/cylc/flow/network/schema.py b/cylc/flow/network/schema.py index 3a8626e2c95..70e40232c1d 100644 --- a/cylc/flow/network/schema.py +++ b/cylc/flow/network/schema.py @@ -502,7 +502,7 @@ async def get_nodes_edges(root, info: 'ResolveInfo', **args): def resolve_state_totals(root, info, **args): - state_totals = {state: 0 for state in TASK_STATUSES_ORDERED} + state_totals = dict.fromkeys(TASK_STATUSES_ORDERED, 0) # Update with converted protobuf map container state_totals.update( dict(getattr(root, to_snake_case(info.field_name), {}))) diff --git a/cylc/flow/task_outputs.py b/cylc/flow/task_outputs.py index 40b9d991b30..1af37e1554e 100644 --- a/cylc/flow/task_outputs.py +++ b/cylc/flow/task_outputs.py @@ -251,11 +251,7 @@ def get_optional_outputs( ) for output in used_compvars }, - # the outputs that are not used in the expression - **{ - output: None - for output in all_compvars - used_compvars - }, + **dict.fromkeys(all_compvars - used_compvars), } diff --git a/cylc/flow/tui/updater.py b/cylc/flow/tui/updater.py index 26a8614b1a3..2a28b5d7906 100644 --- a/cylc/flow/tui/updater.py +++ b/cylc/flow/tui/updater.py @@ -68,11 +68,8 @@ def get_default_filters(): These filters show everything. """ return { - 'tasks': { - # filtered task statuses - state: True - for state in TASK_STATUSES_ORDERED - }, + # filtered task statuses + 'tasks': dict.fromkeys(TASK_STATUSES_ORDERED, True), 'workflows': { # filtered workflow statuses **{