Skip to content

Commit f5cf73b

Browse files
committed
Fix typehint for server type in server.py
1 parent 8986d9e commit f5cf73b

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/ansys/dpf/core/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@
9999
AvailableServerContexts,
100100
LicenseContextManager
101101
)
102+
from ansys.dpf.core.server_types import AnyServerType
102103
from ansys.dpf.core.unit_system import UnitSystem, unit_systems
103104
from ansys.dpf.core.incremental import IncrementalHelper, split_workflow_in_chunks
104105
from ansys.dpf.core.any import Any

src/ansys/dpf/core/server.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
ServerConfig,
4949
ServerFactory,
5050
)
51-
from ansys.dpf.core.server_types import DPF_DEFAULT_PORT, LOCALHOST, RUNNING_DOCKER, BaseServer
51+
from ansys.dpf.core.server_types import DPF_DEFAULT_PORT, LOCALHOST, RUNNING_DOCKER, AnyServerType
5252

5353

5454
def shutdown_global_server():
@@ -73,7 +73,7 @@ def has_local_server():
7373
return dpf.core.SERVER is not None
7474

7575

76-
def _global_server() -> BaseServer:
76+
def _global_server() -> AnyServerType:
7777
"""Retrieve the global server if it exists.
7878
7979
If the global server has not been specified, check the expected server type in
@@ -162,7 +162,7 @@ def start_local_server(
162162
config=None,
163163
use_pypim_by_default=True,
164164
context=None,
165-
) -> BaseServer:
165+
) -> AnyServerType:
166166
"""Start a new local DPF server at a given port and IP address.
167167
168168
This method requires Windows and ANSYS 2021 R1 or later. If ``as_global=True``, which is
@@ -399,12 +399,12 @@ def connect():
399399
raise e
400400

401401

402-
def get_or_create_server(server: BaseServer | None) -> Union[BaseServer, None]:
402+
def get_or_create_server(server: AnyServerType | None) -> Union[AnyServerType, None]:
403403
"""Return the given server or if None, creates a new one.
404404
405405
Parameters
406406
----------
407-
server: BaseServer, None
407+
server:
408408
409409
Returns
410410
-------

0 commit comments

Comments
 (0)