Skip to content

Commit

Permalink
changed the output typing of platform utility functions; these should…
Browse files Browse the repository at this point in the history
… either fail with an error from cylc/flow/platforms or return a platform.
  • Loading branch information
wxtim committed Oct 20, 2021
1 parent 8577a4b commit bc6195c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions cylc/rose/platform_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"""
from optparse import Values
from pathlib import Path
from typing import Optional, Dict, Any
from typing import Dict, Any

from cylc.flow.config import WorkflowConfig
from cylc.flow.rundb import CylcWorkflowDAO
Expand All @@ -29,7 +29,7 @@

def get_platform_from_task_def(
flow: str, task: str
) -> Optional[Dict[str, Any]]:
) -> Dict[str, Any]:
"""Return the platform dictionary for a particular task.
Uses the flow definition - designed to be used with tasks
Expand All @@ -42,7 +42,7 @@ def get_platform_from_task_def(
Returns:
Platform Dictionary.
"""
flow_name, flow_file = parse_reg(flow, src=True)
_, flow_file = parse_reg(flow, src=True)
config = WorkflowConfig(flow, flow_file, Values())
# Get entire task spec to allow Cylc 7 platform from host guessing.
task_spec = config.pcfg.get(['runtime', task])
Expand All @@ -52,7 +52,7 @@ def get_platform_from_task_def(

def get_platforms_from_task_jobs(
flow: str, cyclepoint: str
) -> Optional[Dict[str, Any]]:
) -> Dict[str, Any]:
"""Access flow database. Return platform for task at fixed cycle point
Uses the workflow database - designed to be used with tasks where jobs
Expand All @@ -66,7 +66,7 @@ def get_platforms_from_task_jobs(
Returns:
Platform Dictionary.
"""
flow_name, flow_file = parse_reg(flow, src=True)
_, flow_file = parse_reg(flow, src=True)
dbfilepath = Path(flow_file).parent / '.service/db'
dao = CylcWorkflowDAO(dbfilepath)
task_platform_map: Dict = {}
Expand Down

0 comments on commit bc6195c

Please sign in to comment.