|
1 | | -import warnings |
2 | 1 | from typing import Any, Literal, overload |
3 | 2 |
|
4 | 3 | from cluster_tools.executor_protocol import Executor |
|
17 | 16 | from cluster_tools.schedulers.pbs import PBSExecutor |
18 | 17 | from cluster_tools.schedulers.slurm import SlurmExecutor |
19 | 18 |
|
20 | | -# For backwards-compatibility, remove in version 2.0: |
21 | | -WrappedProcessPoolExecutor = MultiprocessingExecutor |
22 | | - |
23 | 19 |
|
24 | 20 | def _noop() -> bool: |
25 | 21 | return True |
@@ -84,24 +80,12 @@ def get_executor( |
84 | 80 | ) -> MultiprocessingPickleExecutor: ... |
85 | 81 |
|
86 | 82 |
|
87 | | -@overload |
88 | | -def get_executor( |
89 | | - environment: Literal["test_pickling"], **kwargs: Any |
90 | | -) -> MultiprocessingPickleExecutor: ... |
91 | | - |
92 | | - |
93 | 83 | @overload |
94 | 84 | def get_executor( |
95 | 85 | environment: Literal["sequential"], **kwargs: Any |
96 | 86 | ) -> SequentialExecutor: ... |
97 | 87 |
|
98 | 88 |
|
99 | | -@overload |
100 | | -def get_executor( |
101 | | - environment: Literal["debug_sequential"], **kwargs: Any |
102 | | -) -> SequentialExecutor: ... |
103 | | - |
104 | | - |
105 | 89 | @overload |
106 | 90 | def get_executor( |
107 | 91 | environment: Literal["sequential_with_pickling"], **kwargs: Any |
@@ -133,20 +117,4 @@ def get_executor(environment: str, **kwargs: Any) -> "Executor": |
133 | 117 | return SequentialPickleExecutor(**kwargs) |
134 | 118 | elif environment == "multiprocessing_with_pickling": |
135 | 119 | return MultiprocessingPickleExecutor(**kwargs) |
136 | | - elif environment == "test_pickling": |
137 | | - # For backwards-compatibility, remove in version 2.0: |
138 | | - warnings.warn( |
139 | | - "The test_pickling execution strategy is deprecated and will be removed in version 2.0. Use multiprocessing_with_pickling instead.", |
140 | | - DeprecationWarning, |
141 | | - stacklevel=2, |
142 | | - ) |
143 | | - return MultiprocessingPickleExecutor(**kwargs) |
144 | | - elif environment == "debug_sequential": |
145 | | - # For backwards-compatibility, remove in version 2.0: |
146 | | - warnings.warn( |
147 | | - "The debug_sequential execution strategy is deprecated and will be removed in version 2.0. Use sequential instead.", |
148 | | - DeprecationWarning, |
149 | | - stacklevel=2, |
150 | | - ) |
151 | | - return SequentialExecutor(**kwargs) |
152 | 120 | raise Exception("Unknown executor: {}".format(environment)) |
0 commit comments