Skip to content

Commit 079bea0

Browse files
authored
When starting DPF with PyPIM, don't force the usage of a specific version (#666)
The current implementation would fallback on the current `__ansys_version__` if no specific version was requested. However, PyDPF is compatible with multiple DPF version, artificially creating incompatibility. This PR changes this behavior so that by default, no specific version is requested.
1 parent b2671fa commit 079bea0

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

ansys/dpf/core/server_types.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,12 @@ def launch_remote_dpf(version=None):
268268
except ImportError as e:
269269
raise ImportError("Launching a remote session of DPF requires the installation"
270270
+ " of ansys-platform-instancemanagement") from e
271-
version = version or __ansys_version__
272271
pim = pypim.connect()
272+
273+
# Possible improvement:
274+
# When the version is not specified, it would be possible to use
275+
# pim.list_definition(product_name="dpf") and select a version compatible with the current
276+
# pydpf version, following the compatibility rules
273277
instance = pim.create_instance(product_name="dpf", product_version=version)
274278
instance.wait_for_ready()
275279
grpc_service = instance.services["grpc"]

tests/test_launcher_remote.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import pytest
77

88
from ansys.dpf.core import server_types
9-
from ansys.dpf.core.misc import __ansys_version__
109
from ansys.dpf.core.server_factory import ServerFactory
1110
from conftest import running_docker
1211

@@ -54,7 +53,7 @@ def test_start_remote(monkeypatch):
5453

5554
# It created a remote instance through PyPIM
5655
mock_client.create_instance.assert_called_with(
57-
product_name="dpf", product_version=__ansys_version__
56+
product_name="dpf", product_version=None
5857
)
5958

6059
# It waited for this instance to be ready

0 commit comments

Comments
 (0)