Skip to content

Commit

Permalink
better type
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian-B committed Nov 26, 2024
1 parent c26d5a8 commit 858bc86
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions spalloc_client/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import subprocess
import time
from types import TracebackType
from typing import Any, cast, Dict, Optional, Tuple, Type
from typing import Any, cast, Dict, Optional, Tuple, Type, Union
import sys

from typing_extensions import Literal, Self
Expand Down Expand Up @@ -127,7 +127,7 @@ class Job(object):
allocated.
"""

def __init__(self, *args: int, **kwargs: Dict[str, Any]):
def __init__(self, *args: int, **kwargs: Union[float, str, None]):
""" Request a SpiNNaker machine.
A :py:class:`.Job` is constructed in one of the following styles::
Expand Down
5 changes: 3 additions & 2 deletions spalloc_client/scripts/alloc.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,8 @@ def parse_argv(argv: Optional[List[str]]) -> Tuple[
return parser, parser.parse_args(argv)


def run_job(job_args: List[int], job_kwargs: Dict[str, Any],
def run_job(job_args: List[int],
job_kwargs: Dict[str, Union[float, str, None]],
ip_file_filename: str) -> int:
"""
Run a job
Expand Down Expand Up @@ -497,7 +498,7 @@ def main(argv: Optional[List[str]] = None) -> int:
parser.error("--hostname of spalloc server must be specified")

# Set universal job arguments
job_kwargs = {
job_kwargs: Dict[str, Union[float, str, None]] = {
"hostname": arguments.hostname,
"port": arguments.port,
"reconnect_delay": _minzero(arguments.reconnect_delay),
Expand Down

0 comments on commit 858bc86

Please sign in to comment.