1
1
"""Shared context objects that replace use of kwargs."""
2
2
import copy
3
3
import threading
4
- from typing import Any , Callable , Dict , Iterable , List , MutableMapping , Optional
4
+ from typing import Any , Callable , Dict , Iterable , List , Optional , Union
5
5
6
6
# move to a regular typing import when Python 3.3-3.6 is no longer supported
7
7
from ruamel .yaml .comments import CommentedMap
19
19
20
20
if TYPE_CHECKING :
21
21
from .process import Process
22
- from .provenance import (
23
- ResearchObject , # pylint: disable=unused-import
24
- )
22
+ from .provenance import ResearchObject # pylint: disable=unused-import
25
23
from .provenance_profile import ProvenanceProfile
26
24
27
25
@@ -47,10 +45,10 @@ class LoadingContext(ContextBase):
47
45
def __init__ (self , kwargs : Optional [Dict [str , Any ]] = None ) -> None :
48
46
"""Initialize the LoadingContext from the kwargs."""
49
47
self .debug = False # type: bool
50
- self .metadata = {} # type: Dict[str, Any]
48
+ self .metadata = {} # type: CWLObjectType
51
49
self .requirements = None # type: Optional[List[CWLObjectType]]
52
50
self .hints = None # type: Optional[List[CWLObjectType]]
53
- self .overrides_list = [] # type: List[Dict[str, Any] ]
51
+ self .overrides_list = [] # type: List[CWLObjectType ]
54
52
self .loader = None # type: Optional[Loader]
55
53
self .avsc_names = None # type: Optional[Names]
56
54
self .disable_js_validation = False # type: bool
@@ -82,7 +80,7 @@ class RuntimeContext(ContextBase):
82
80
def __init__ (self , kwargs : Optional [Dict [str , Any ]] = None ) -> None :
83
81
"""Initializet the RuntimeContext from the kwargs."""
84
82
select_resources_callable = Callable [ # pylint: disable=unused-variable
85
- [Dict [str , int ] , RuntimeContext ], Dict [str , int ]
83
+ [Dict [str , Union [ int , float ]] , RuntimeContext ], Dict [str , Union [ int , float ] ]
86
84
]
87
85
self .user_space_docker_cmd = "" # type: Optional[str]
88
86
self .secret_store = None # type: Optional[SecretStore]
@@ -130,7 +128,7 @@ def __init__(self, kwargs: Optional[Dict[str, Any]] = None) -> None:
130
128
self .eval_timeout = 20 # type: float
131
129
self .postScatterEval = (
132
130
None
133
- ) # type: Optional[Callable[[MutableMapping[str, Any]] , Optional[MutableMapping[str, Any] ]]]
131
+ ) # type: Optional[Callable[[CWLObjectType] , Optional[CWLObjectType ]]]
134
132
self .on_error = "stop" # type: str
135
133
self .strict_memory_limit = False # type: bool
136
134
0 commit comments