Skip to content

Commit

Permalink
Fix mypy types
Browse files Browse the repository at this point in the history
  • Loading branch information
stxue1 committed Nov 20, 2024
1 parent d3aa7d5 commit 03365dd
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/toil/cwl/cwltoil.py
Original file line number Diff line number Diff line change
Expand Up @@ -1832,8 +1832,8 @@ def path_to_loc(obj: CWLObjectType) -> None:


def extract_file_uri_once(
fileindex: Dict[str, str],
existing: Dict[str, str],
fileindex: dict[str, str],
existing: dict[str, str],
file_metadata: CWLObjectType,
mark_broken: bool = False,
skip_remote: bool = False,
Expand Down Expand Up @@ -1909,7 +1909,7 @@ def visit_files(
mark_broken: bool = False,
skip_remote: bool = False,
bypass_file_store: bool = False,
) -> List[V]:
) -> list[V]:
"""
Prepare all files and directories.
Expand Down Expand Up @@ -1955,7 +1955,7 @@ def visit_files(
:param log_level: Log imported files at the given level.
"""
func_return: List[Any] = list()
func_return: list[Any] = list()
tool_id = cwl_object.get("id", str(cwl_object)) if cwl_object else ""

logger.debug("Importing files for %s", tool_id)
Expand Down Expand Up @@ -3521,7 +3521,7 @@ def __init__(
basedir: str,
skip_remote: bool,
bypass_file_store: bool,
import_data: Promised[Dict[str, FileID]],
import_data: Promised[dict[str, FileID]],
**kwargs: Any,
) -> None:
"""
Expand All @@ -3543,7 +3543,7 @@ def run(self, file_store: AbstractFileStore) -> Tuple[Process, CWLObjectType]:
Convert the filenames in the workflow inputs into the URIs
:return: Promise of transformed workflow inputs. A tuple of the job order and process
"""
candidate_to_fileid = unwrap(self.import_data)
candidate_to_fileid: dict[str, FileID] = unwrap(self.import_data)

initialized_job_order = unwrap(self.initialized_job_order)
tool = unwrap(self.tool)
Expand All @@ -3554,8 +3554,8 @@ def convert_file(filename: str) -> FileID:

file_convert_function = functools.partial(extract_and_convert_file_to_toil_uri, convert_file)
fs_access = ToilFsAccess(self.basedir)
fileindex: Dict[str, str] = {}
existing: Dict[str, str] = {}
fileindex: dict[str, str] = {}
existing: dict[str, str] = {}
visit_files(
file_convert_function,
fs_access,
Expand Down Expand Up @@ -3683,8 +3683,8 @@ def extract_workflow_inputs(
:param tool: tool object
:return:
"""
fileindex: Dict[str, str] = {}
existing: Dict[str, str] = {}
fileindex: dict[str, str] = {}
existing: dict[str, str] = {}

# Extract out all the input files' filenames
logger.info("Collecting input files...")
Expand Down Expand Up @@ -3736,8 +3736,8 @@ def import_workflow_inputs(
:param log_level: log level
:return:
"""
fileindex: Dict[str, str] = {}
existing: Dict[str, str] = {}
fileindex: dict[str, str] = {}
existing: dict[str, str] = {}

# Define something we can call to import a file and get its file
# ID.
Expand Down Expand Up @@ -3799,8 +3799,8 @@ def file_import_function(url: str) -> FileID:
T = TypeVar("T")
def visitSteps(
cmdline_tool: Process,
op: Callable[[CommentedMap], List[T]],
) -> List[T]:
op: Callable[[CommentedMap], list[T]],
) -> list[T]:
"""
Iterate over a CWL Process object, running the op on each tool description
CWL object.
Expand Down

0 comments on commit 03365dd

Please sign in to comment.