Skip to content

Commit e6d2953

Browse files
chore: cleanup of deprecated arguments and methods (#2420)
Co-authored-by: pyansys-ci-bot <[email protected]>
1 parent 47d5cf6 commit e6d2953

File tree

10 files changed

+7
-375
lines changed

10 files changed

+7
-375
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Cleanup of deprecated arguments and methods

src/ansys/geometry/core/connection/client.py

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@
3939
from ansys.geometry.core.connection.docker_instance import LocalDockerInstance
4040
from ansys.geometry.core.connection.product_instance import ProductInstance
4141
from ansys.geometry.core.logger import LOG, PyGeometryCustomAdapter
42-
from ansys.geometry.core.misc.checks import deprecated_method
4342
from ansys.geometry.core.typing import Real
4443

4544
try:
@@ -370,22 +369,6 @@ def backend_version(self) -> semver.version.Version:
370369
"""
371370
return self._backend_version
372371

373-
@property
374-
@deprecated_method(
375-
info="Multiple designs for the same service are no longer supported.",
376-
version="0.9.0",
377-
remove="0.11.0",
378-
)
379-
def multiple_designs_allowed(self) -> bool:
380-
"""Flag indicating whether multiple designs are allowed.
381-
382-
Notes
383-
-----
384-
Currently, only one design is allowed per service. This method will always
385-
return ``False``.
386-
"""
387-
return False
388-
389372
@property
390373
def channel(self) -> grpc.Channel:
391374
"""Client gRPC channel."""

src/ansys/geometry/core/connection/launcher.py

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
from ansys.geometry.core.logger import LOG
3838
from ansys.geometry.core.misc.checks import (
3939
check_type,
40-
deprecated_argument,
4140
kwargs_passed_not_accepted,
4241
)
4342

@@ -511,7 +510,6 @@ def launch_modeler_with_spaceclaim_and_pimlight(
511510
)
512511

513512

514-
@deprecated_argument("product_version", "version", version="0.10.8", remove="0.13.0")
515513
@kwargs_passed_not_accepted
516514
def launch_modeler_with_geometry_service(
517515
version: str | int | None = None,
@@ -528,7 +526,6 @@ def launch_modeler_with_geometry_service(
528526
uds_dir: Path | str | None = None,
529527
uds_id: str | None = None,
530528
certs_dir: Path | str | None = None,
531-
product_version: int = None, # DEPRECATED: use `version` instead
532529
**kwargs: dict | None,
533530
) -> "Modeler":
534531
"""Start the Geometry service locally using the ``ProductInstance`` class.
@@ -596,8 +593,6 @@ def launch_modeler_with_geometry_service(
596593
By default `None` and thus search for the "ANSYS_GRPC_CERTIFICATES" environment variable.
597594
If not found, it will use the "certs" folder assuming it is in the current working
598595
directory.
599-
product_version: int, optional
600-
The product version to be started. Deprecated, use `version` instead.
601596
**kwargs : dict, default: None
602597
Placeholder to prevent errors when passing additional arguments that
603598
are not compatible with this method.
@@ -658,11 +653,9 @@ def launch_modeler_with_geometry_service(
658653
uds_dir=uds_dir,
659654
uds_id=uds_id,
660655
certs_dir=certs_dir,
661-
product_version=product_version,
662656
)
663657

664658

665-
@deprecated_argument("product_version", "version", version="0.10.8", remove="0.13.0")
666659
@kwargs_passed_not_accepted
667660
def launch_modeler_with_discovery(
668661
version: str | int | None = None,
@@ -680,7 +673,6 @@ def launch_modeler_with_discovery(
680673
uds_dir: Path | str | None = None,
681674
uds_id: str | None = None,
682675
certs_dir: Path | str | None = None,
683-
product_version: int = None, # DEPRECATED: use `version` instead
684676
**kwargs: dict | None,
685677
):
686678
"""Start Ansys Discovery locally using the ``ProductInstance`` class.
@@ -750,8 +742,6 @@ def launch_modeler_with_discovery(
750742
By default `None` and thus search for the "ANSYS_GRPC_CERTIFICATES" environment variable.
751743
If not found, it will use the "certs" folder assuming it is in the current working
752744
directory.
753-
product_version: int, optional
754-
The product version to be started. Deprecated, use `version` instead.
755745
**kwargs : dict, default: None
756746
Placeholder to prevent errors when passing additional arguments that
757747
are not compatible with this method.
@@ -782,7 +772,7 @@ def launch_modeler_with_discovery(
782772
with chatty logs, using API v231 and a ``300`` seconds timeout:
783773
784774
>>> from ansys.geometry.core import launch_modeler_with_discovery
785-
>>> modeler = launch_modeler_with_discovery(product_version = 241,
775+
>>> modeler = launch_modeler_with_discovery(version = 241,
786776
host="10.171.22.44",
787777
port=5001,
788778
api_version= 231,
@@ -807,11 +797,9 @@ def launch_modeler_with_discovery(
807797
uds_dir=uds_dir,
808798
uds_id=uds_id,
809799
certs_dir=certs_dir,
810-
product_version=product_version,
811800
)
812801

813802

814-
@deprecated_argument("product_version", "version", version="0.10.8", remove="0.13.0")
815803
@kwargs_passed_not_accepted
816804
def launch_modeler_with_spaceclaim(
817805
version: str | int | None = None,
@@ -829,7 +817,6 @@ def launch_modeler_with_spaceclaim(
829817
uds_dir: Path | str | None = None,
830818
uds_id: str | None = None,
831819
certs_dir: Path | str | None = None,
832-
product_version: int = None, # DEPRECATED: use `version` instead
833820
**kwargs: dict | None,
834821
):
835822
"""Start Ansys SpaceClaim locally using the ``ProductInstance`` class.
@@ -899,8 +886,6 @@ def launch_modeler_with_spaceclaim(
899886
By default `None` and thus search for the "ANSYS_GRPC_CERTIFICATES" environment variable.
900887
If not found, it will use the "certs" folder assuming it is in the current working
901888
directory.
902-
product_version: int, optional
903-
The product version to be started. Deprecated, use `version` instead.
904889
**kwargs : dict, default: None
905890
Placeholder to prevent errors when passing additional arguments that
906891
are not compatible with this method.
@@ -931,7 +916,7 @@ def launch_modeler_with_spaceclaim(
931916
with chatty logs, using API v231 and a ``300`` seconds timeout:
932917
933918
>>> from ansys.geometry.core import launch_modeler_with_spaceclaim
934-
>>> modeler = launch_modeler_with_spaceclaim(product_version = 241,
919+
>>> modeler = launch_modeler_with_spaceclaim(version = 241,
935920
host="10.171.22.44",
936921
port=5001,
937922
api_version= 231,
@@ -956,11 +941,9 @@ def launch_modeler_with_spaceclaim(
956941
uds_dir=uds_dir,
957942
uds_id=uds_id,
958943
certs_dir=certs_dir,
959-
product_version=product_version,
960944
)
961945

962946

963-
@deprecated_argument("product_version", "version", version="0.10.8", remove="0.13.0")
964947
@kwargs_passed_not_accepted
965948
def launch_modeler_with_core_service(
966949
version: str | int | None = None,
@@ -977,7 +960,6 @@ def launch_modeler_with_core_service(
977960
uds_dir: Path | str | None = None,
978961
uds_id: str | None = None,
979962
certs_dir: Path | str | None = None,
980-
product_version: int = None, # DEPRECATED: use `version` instead
981963
**kwargs: dict | None,
982964
) -> "Modeler":
983965
"""Start the Geometry Core service locally using the ``ProductInstance`` class.
@@ -1045,8 +1027,6 @@ def launch_modeler_with_core_service(
10451027
By default `None` and thus search for the "ANSYS_GRPC_CERTIFICATES" environment variable.
10461028
If not found, it will use the "certs" folder assuming it is in the current working
10471029
directory.
1048-
product_version: int, optional
1049-
The product version to be started. Deprecated, use `version` instead.
10501030
**kwargs : dict, default: None
10511031
Placeholder to prevent errors when passing additional arguments that
10521032
are not compatible with this method.
@@ -1108,7 +1088,6 @@ def launch_modeler_with_core_service(
11081088
uds_id=uds_id,
11091089
certs_dir=certs_dir,
11101090
specific_minimum_version=252,
1111-
product_version=product_version,
11121091
)
11131092

11141093

src/ansys/geometry/core/connection/product_instance.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,6 @@ def prepare_and_start_backend(
196196
certs_dir: Path | str | None = None,
197197
specific_minimum_version: int = None,
198198
server_working_dir: str | Path | None = None,
199-
product_version: int | None = None, # Deprecated, use `version` instead.
200199
) -> "Modeler":
201200
"""Start the requested service locally using the ``ProductInstance`` class.
202201
@@ -269,8 +268,6 @@ def prepare_and_start_backend(
269268
By default `None` and thus search for the "ANSYS_GRPC_CERTIFICATES" environment variable.
270269
If not found, it will use the "certs" folder assuming it is in the current working
271270
directory.
272-
product_version: ``int``, optional
273-
The product version to be started. Deprecated, use `version` instead.
274271
275272
Returns
276273
-------
@@ -288,16 +285,6 @@ def prepare_and_start_backend(
288285
"""
289286
from ansys.geometry.core.modeler import Modeler
290287

291-
# Handle deprecated product_version argument
292-
if product_version is not None and version is not None:
293-
raise ValueError(
294-
"Both 'product_version' and 'version' arguments are provided. "
295-
"Please use only 'version'."
296-
)
297-
if product_version is not None:
298-
LOG.warning("The 'product_version' argument is deprecated. Please use 'version' instead.")
299-
version = product_version
300-
301288
if os.name != "nt" and not BackendType.is_linux_service(backend_type): # pragma: no cover
302289
raise RuntimeError(
303290
"Method 'prepare_and_start_backend' is only available on Windows."

src/ansys/geometry/core/math/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
# SOFTWARE.
2222
"""PyAnsys Geometry math subpackage."""
2323

24-
from ansys.geometry.core.math.bbox import BoundingBox, BoundingBox2D
24+
from ansys.geometry.core.math.bbox import BoundingBox
2525
from ansys.geometry.core.math.constants import (
2626
DEFAULT_POINT2D,
2727
DEFAULT_POINT3D,

0 commit comments

Comments
 (0)