Skip to content

Commit

Permalink
Update run mode in schema (#609)
Browse files Browse the repository at this point in the history
  • Loading branch information
MetRonnie authored Dec 4, 2024
1 parent 499d323 commit 01a2595
Showing 1 changed file with 3 additions and 25 deletions.
28 changes: 3 additions & 25 deletions cylc/uiserver/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,11 @@
STRIP_NULL_DEFAULT,
Subscriptions,
WorkflowID,
WorkflowRunMode as RunMode,
_mut_field,
sstrip,
get_nodes_all
)
from cylc.flow.util import sstrip
from cylc.uiserver.resolvers import (
Resolvers,
list_log_files,
Expand Down Expand Up @@ -81,29 +82,6 @@ async def mutator(
return GenericResponse(result=res)


class RunMode(graphene.Enum):
"""The mode to run a workflow in."""

Live = 'live'
Dummy = 'dummy'
DummyLocal = 'dummy-local'
Simulation = 'simulation'

@property
def description(self):
if self == RunMode.Live:
return 'The normal default run mode'
if self == RunMode.Dummy:
return 'Replaces all *-script items with nothing'
if self == RunMode.DummyLocal:
return (
'Replaces all *-script items with nothing and sets'
' platform = localhost for all tasks.'
)
if self == RunMode.Simulation:
return 'Simulates job submission, does not run anything at all.'


class CylcVersion(graphene.String):
"""A Cylc version identifier e.g. 8.0.0"""

Expand Down Expand Up @@ -170,7 +148,7 @@ class Arguments:
''')
)
mode = RunMode(
default_value=RunMode.Live.name # type: ignore[attr-defined]
default_value=RunMode.Live.name
)
host = graphene.String(
description=sstrip('''
Expand Down

0 comments on commit 01a2595

Please sign in to comment.