Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/changelog.d/2420.maintenance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Cleanup of deprecated arguments and methods
17 changes: 0 additions & 17 deletions src/ansys/geometry/core/connection/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
from ansys.geometry.core.connection.docker_instance import LocalDockerInstance
from ansys.geometry.core.connection.product_instance import ProductInstance
from ansys.geometry.core.logger import LOG, PyGeometryCustomAdapter
from ansys.geometry.core.misc.checks import deprecated_method
from ansys.geometry.core.typing import Real

try:
Expand Down Expand Up @@ -370,22 +369,6 @@ def backend_version(self) -> semver.version.Version:
"""
return self._backend_version

@property
@deprecated_method(
info="Multiple designs for the same service are no longer supported.",
version="0.9.0",
remove="0.11.0",
)
def multiple_designs_allowed(self) -> bool:
"""Flag indicating whether multiple designs are allowed.

Notes
-----
Currently, only one design is allowed per service. This method will always
return ``False``.
"""
return False

@property
def channel(self) -> grpc.Channel:
"""Client gRPC channel."""
Expand Down
25 changes: 2 additions & 23 deletions src/ansys/geometry/core/connection/launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
from ansys.geometry.core.logger import LOG
from ansys.geometry.core.misc.checks import (
check_type,
deprecated_argument,
kwargs_passed_not_accepted,
)

Expand Down Expand Up @@ -511,7 +510,6 @@ def launch_modeler_with_spaceclaim_and_pimlight(
)


@deprecated_argument("product_version", "version", version="0.10.8", remove="0.13.0")
@kwargs_passed_not_accepted
def launch_modeler_with_geometry_service(
version: str | int | None = None,
Expand All @@ -528,7 +526,6 @@ def launch_modeler_with_geometry_service(
uds_dir: Path | str | None = None,
uds_id: str | None = None,
certs_dir: Path | str | None = None,
product_version: int = None, # DEPRECATED: use `version` instead
**kwargs: dict | None,
) -> "Modeler":
"""Start the Geometry service locally using the ``ProductInstance`` class.
Expand Down Expand Up @@ -596,8 +593,6 @@ def launch_modeler_with_geometry_service(
By default `None` and thus search for the "ANSYS_GRPC_CERTIFICATES" environment variable.
If not found, it will use the "certs" folder assuming it is in the current working
directory.
product_version: int, optional
The product version to be started. Deprecated, use `version` instead.
**kwargs : dict, default: None
Placeholder to prevent errors when passing additional arguments that
are not compatible with this method.
Expand Down Expand Up @@ -658,11 +653,9 @@ def launch_modeler_with_geometry_service(
uds_dir=uds_dir,
uds_id=uds_id,
certs_dir=certs_dir,
product_version=product_version,
)


@deprecated_argument("product_version", "version", version="0.10.8", remove="0.13.0")
@kwargs_passed_not_accepted
def launch_modeler_with_discovery(
version: str | int | None = None,
Expand All @@ -680,7 +673,6 @@ def launch_modeler_with_discovery(
uds_dir: Path | str | None = None,
uds_id: str | None = None,
certs_dir: Path | str | None = None,
product_version: int = None, # DEPRECATED: use `version` instead
**kwargs: dict | None,
):
"""Start Ansys Discovery locally using the ``ProductInstance`` class.
Expand Down Expand Up @@ -750,8 +742,6 @@ def launch_modeler_with_discovery(
By default `None` and thus search for the "ANSYS_GRPC_CERTIFICATES" environment variable.
If not found, it will use the "certs" folder assuming it is in the current working
directory.
product_version: int, optional
The product version to be started. Deprecated, use `version` instead.
**kwargs : dict, default: None
Placeholder to prevent errors when passing additional arguments that
are not compatible with this method.
Expand Down Expand Up @@ -782,7 +772,7 @@ def launch_modeler_with_discovery(
with chatty logs, using API v231 and a ``300`` seconds timeout:

>>> from ansys.geometry.core import launch_modeler_with_discovery
>>> modeler = launch_modeler_with_discovery(product_version = 241,
>>> modeler = launch_modeler_with_discovery(version = 241,
host="10.171.22.44",
port=5001,
api_version= 231,
Expand All @@ -807,11 +797,9 @@ def launch_modeler_with_discovery(
uds_dir=uds_dir,
uds_id=uds_id,
certs_dir=certs_dir,
product_version=product_version,
)


@deprecated_argument("product_version", "version", version="0.10.8", remove="0.13.0")
@kwargs_passed_not_accepted
def launch_modeler_with_spaceclaim(
version: str | int | None = None,
Expand All @@ -829,7 +817,6 @@ def launch_modeler_with_spaceclaim(
uds_dir: Path | str | None = None,
uds_id: str | None = None,
certs_dir: Path | str | None = None,
product_version: int = None, # DEPRECATED: use `version` instead
**kwargs: dict | None,
):
"""Start Ansys SpaceClaim locally using the ``ProductInstance`` class.
Expand Down Expand Up @@ -899,8 +886,6 @@ def launch_modeler_with_spaceclaim(
By default `None` and thus search for the "ANSYS_GRPC_CERTIFICATES" environment variable.
If not found, it will use the "certs" folder assuming it is in the current working
directory.
product_version: int, optional
The product version to be started. Deprecated, use `version` instead.
**kwargs : dict, default: None
Placeholder to prevent errors when passing additional arguments that
are not compatible with this method.
Expand Down Expand Up @@ -931,7 +916,7 @@ def launch_modeler_with_spaceclaim(
with chatty logs, using API v231 and a ``300`` seconds timeout:

>>> from ansys.geometry.core import launch_modeler_with_spaceclaim
>>> modeler = launch_modeler_with_spaceclaim(product_version = 241,
>>> modeler = launch_modeler_with_spaceclaim(version = 241,
host="10.171.22.44",
port=5001,
api_version= 231,
Expand All @@ -956,11 +941,9 @@ def launch_modeler_with_spaceclaim(
uds_dir=uds_dir,
uds_id=uds_id,
certs_dir=certs_dir,
product_version=product_version,
)


@deprecated_argument("product_version", "version", version="0.10.8", remove="0.13.0")
@kwargs_passed_not_accepted
def launch_modeler_with_core_service(
version: str | int | None = None,
Expand All @@ -977,7 +960,6 @@ def launch_modeler_with_core_service(
uds_dir: Path | str | None = None,
uds_id: str | None = None,
certs_dir: Path | str | None = None,
product_version: int = None, # DEPRECATED: use `version` instead
**kwargs: dict | None,
) -> "Modeler":
"""Start the Geometry Core service locally using the ``ProductInstance`` class.
Expand Down Expand Up @@ -1045,8 +1027,6 @@ def launch_modeler_with_core_service(
By default `None` and thus search for the "ANSYS_GRPC_CERTIFICATES" environment variable.
If not found, it will use the "certs" folder assuming it is in the current working
directory.
product_version: int, optional
The product version to be started. Deprecated, use `version` instead.
**kwargs : dict, default: None
Placeholder to prevent errors when passing additional arguments that
are not compatible with this method.
Expand Down Expand Up @@ -1108,7 +1088,6 @@ def launch_modeler_with_core_service(
uds_id=uds_id,
certs_dir=certs_dir,
specific_minimum_version=252,
product_version=product_version,
)


Expand Down
13 changes: 0 additions & 13 deletions src/ansys/geometry/core/connection/product_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ def prepare_and_start_backend(
certs_dir: Path | str | None = None,
specific_minimum_version: int = None,
server_working_dir: str | Path | None = None,
product_version: int | None = None, # Deprecated, use `version` instead.
) -> "Modeler":
"""Start the requested service locally using the ``ProductInstance`` class.

Expand Down Expand Up @@ -269,8 +268,6 @@ def prepare_and_start_backend(
By default `None` and thus search for the "ANSYS_GRPC_CERTIFICATES" environment variable.
If not found, it will use the "certs" folder assuming it is in the current working
directory.
product_version: ``int``, optional
The product version to be started. Deprecated, use `version` instead.

Returns
-------
Expand All @@ -288,16 +285,6 @@ def prepare_and_start_backend(
"""
from ansys.geometry.core.modeler import Modeler

# Handle deprecated product_version argument
if product_version is not None and version is not None:
raise ValueError(
"Both 'product_version' and 'version' arguments are provided. "
"Please use only 'version'."
)
if product_version is not None:
LOG.warning("The 'product_version' argument is deprecated. Please use 'version' instead.")
version = product_version

if os.name != "nt" and not BackendType.is_linux_service(backend_type): # pragma: no cover
raise RuntimeError(
"Method 'prepare_and_start_backend' is only available on Windows."
Expand Down
2 changes: 1 addition & 1 deletion src/ansys/geometry/core/math/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# SOFTWARE.
"""PyAnsys Geometry math subpackage."""

from ansys.geometry.core.math.bbox import BoundingBox, BoundingBox2D
from ansys.geometry.core.math.bbox import BoundingBox
from ansys.geometry.core.math.constants import (
DEFAULT_POINT2D,
DEFAULT_POINT3D,
Expand Down
Loading
Loading