Skip to content

build: bump PyVista and VTK versions (support Python 3.13) #1924

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Apr 21, 2025
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
19 changes: 17 additions & 2 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- main

env:
MAIN_PYTHON_VERSION: '3.12'
MAIN_PYTHON_VERSION: '3.13'
PACKAGE_NAME: 'ansys-geometry-core'
DOCUMENTATION_CNAME: 'geometry.docs.pyansys.com'
ANSRV_GEO_IMAGE: 'ghcr.io/ansys/geometry'
Expand Down Expand Up @@ -401,6 +401,12 @@ jobs:
echo "SKIP_UNSTABLE=$Result" >> $GITHUB_ENV
echo "SKIP_UNSTABLE will be: $Result"

- name: Set up headless display
if: env.SKIP_UNSTABLE == 'false'
uses: pyvista/setup-headless-display-action@52bda06d59c0fc422fc2512c9c670bf6b66616f8 # v3.2
with:
pyvista: false

- name: Login in Github Container registry
if: env.SKIP_UNSTABLE == 'false'
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
Expand Down Expand Up @@ -474,6 +480,11 @@ jobs:
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13']
steps:
- name: Set up headless display
uses: pyvista/setup-headless-display-action@52bda06d59c0fc422fc2512c9c670bf6b66616f8 # v3.2
with:
pyvista: false

- name: Login in Github Container registry
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
with:
Expand Down Expand Up @@ -769,6 +780,11 @@ jobs:
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}

- name: Set up headless display
uses: pyvista/setup-headless-display-action@52bda06d59c0fc422fc2512c9c670bf6b66616f8 # v3.2
with:
pyvista: false

- name: Download Linux binaries
uses: actions/download-artifact@95815c38cf2ff2164869cbab79da8d1f422bc89e # v4.2.1
with:
Expand Down Expand Up @@ -805,7 +821,6 @@ jobs:
python-version: ${{ env.MAIN_PYTHON_VERSION }}
pytest-extra-args: "--use-existing-service=yes"
checkout: false
requires-xvfb: true
randomize: true

- name: "Compressing Linux Dockerfile"
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/nightly_docker_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ on:
- v*

env:
MAIN_PYTHON_VERSION: '3.12'
MAIN_PYTHON_VERSION: '3.13'
ANSRV_GEO_IMAGE_WINDOWS_CORE_TAG: ghcr.io/ansys/geometry:core-windows-latest-unstable
ANSRV_GEO_IMAGE_LINUX_CORE_TAG: ghcr.io/ansys/geometry:core-linux-latest-unstable
ANSRV_GEO_PORT: 710
Expand Down Expand Up @@ -220,7 +220,6 @@ jobs:
ALLOW_PLOTTING: true
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}
requires-xvfb: true

- name: Stop the Geometry service
if: always()
Expand Down
1 change: 1 addition & 0 deletions doc/changelog.d/1924.dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bump PyVista and VTK versions (support Python 3.13)
1 change: 1 addition & 0 deletions doc/changelog.d/1925.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
docstyle ordering
14 changes: 6 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ all = [
tests = [
"ansys-platform-instancemanagement==1.1.2",
"ansys-tools-path==0.7.1",
"ansys-tools-visualization-interface==0.8.3",
"ansys-tools-visualization-interface==0.9.1",
"beartype==0.20.2",
"docker==7.1.0",
"geomdl==5.3.1",
Expand All @@ -72,24 +72,22 @@ tests = [
"pytest==8.3.5",
"pytest-cov==6.1.1",
"pytest-pyvista==0.1.9",
"pytest-xvfb==3.1.1",
"pyvista[jupyter]==0.44.2",
"pyvista[jupyter]==0.45.0",
"requests==2.32.3",
"scipy==1.15.2",
"semver==3.0.4",
"six==1.17.0",
"vtk==9.3.1",
"vtk==9.4.2",
]
tests-minimal = [
"pytest==8.3.5",
"pytest-cov==6.1.1",
"pytest-pyvista==0.1.9",
"pytest-xvfb==3.1.1",
]
doc = [
"ansys-sphinx-theme[autoapi]==1.4.2",
"ansys-tools-path==0.7.1",
"ansys-tools-visualization-interface==0.8.3",
"ansys-tools-visualization-interface==0.9.1",
"beartype==0.20.2",
"docker==7.1.0",
"geomdl==5.3.1",
Expand All @@ -110,7 +108,7 @@ doc = [
"Pint==0.24.4",
"protobuf==5.29.3",
"pygltflib==1.16.3",
"pyvista[jupyter]==0.44.2",
"pyvista[jupyter]==0.45.0",
"quarto-cli==1.6.42",
"requests==2.32.3",
"scipy==1.15.2",
Expand All @@ -121,7 +119,7 @@ doc = [
"sphinx-copybutton==0.5.2",
"sphinx-jinja==2.0.2",
"trame-vtk==2.8.15",
"vtk==9.3.1",
"vtk==9.4.2",
]

[project.urls]
Expand Down
16 changes: 8 additions & 8 deletions src/ansys/geometry/core/_grpc/_services/_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,21 @@ class _GRPCServices:
"""
Placeholder for the gRPC services (i.e. stubs).

Notes
-----
This class provides a unified interface to access the different
gRPC services available in the Geometry API. It allows for easy
switching between different versions of the API by using the
`version` parameter in the constructor. The services are lazy-loaded
to avoid unnecessary imports and to improve performance.

Parameters
----------
channel : grpc.Channel
The gRPC channel to the server.
version : GeometryApiProtos | str | None
The version of the gRPC API protocol to use. If None, the latest
version is used.

Notes
-----
This class provides a unified interface to access the different
gRPC services available in the Geometry API. It allows for easy
switching between different versions of the API by using the
`version` parameter in the constructor. The services are lazy-loaded
to avoid unnecessary imports and to improve performance.
"""

def __init__(self, channel: grpc.Channel, version: GeometryApiProtos | str | None = None):
Expand Down
10 changes: 5 additions & 5 deletions src/ansys/geometry/core/_grpc/_services/base/conversions.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,6 @@ def from_measurement_to_server_angle(input: Measurement) -> float:
def to_distance(value: float | int) -> Distance:
"""Convert a server value to a Distance object.

Notes
-----
The value is converted to a Distance object using the default server length unit.
The value should represent a length in the server's unit system.

Parameters
----------
value : float | int
Expand All @@ -73,5 +68,10 @@ def to_distance(value: float | int) -> Distance:
-------
Distance
Converted distance.

Notes
-----
The value is converted to a Distance object using the default server length unit.
The value should represent a length in the server's unit system.
"""
return Distance(value, DEFAULT_UNITS.SERVER_LENGTH)
8 changes: 4 additions & 4 deletions src/ansys/geometry/core/_grpc/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,6 @@ def from_string(version_string: str) -> "GeometryApiProtos":
def verify_supported(self, channel: grpc.Channel) -> bool:
"""Check if the version is supported.

Notes
-----
This method checks if the server supports the gRPC API protocol version.

Parameters
----------
channel : grpc.Channel
Expand All @@ -84,6 +80,10 @@ def verify_supported(self, channel: grpc.Channel) -> bool:
-------
bool
True if the server supports the version, otherwise False.

Notes
-----
This method checks if the server supports the gRPC API protocol version.
"""
pb2_grpc = self.value[1]
if pb2_grpc is None:
Expand Down
18 changes: 9 additions & 9 deletions src/ansys/geometry/core/connection/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@
def _create_geometry_channel(target: str) -> grpc.Channel:
"""Create a Geometry service gRPC channel.

Notes
-----
Contains specific options for the Geometry service.

Parameters
----------
target : str
Expand All @@ -65,6 +61,10 @@ def _create_geometry_channel(target: str) -> grpc.Channel:
-------
~grpc.Channel
gRPC channel for the Geometry service.

Notes
-----
Contains specific options for the Geometry service.
"""
return grpc.insecure_channel(
target,
Expand Down Expand Up @@ -94,16 +94,16 @@ def wait_until_healthy(channel: grpc.Channel | str, timeout: float) -> grpc.Chan
* If the total elapsed time exceeds the value for the ``timeout`` parameter,
a ``TimeoutError`` is raised.

Raises
------
TimeoutError
Raised when the total elapsed time exceeds the value for the ``timeout`` parameter.

Returns
-------
grpc.Channel
The channel that was passed in. This channel is guaranteed to be healthy.
If a string was passed in, a channel is created using the default insecure channel.

Raises
------
TimeoutError
Raised when the total elapsed time exceeds the value for the ``timeout`` parameter.
"""
t_max = time.time() + timeout
t_out = 0.1
Expand Down
20 changes: 10 additions & 10 deletions src/ansys/geometry/core/designer/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,12 +506,6 @@ def set_shared_topology(self, share_type: SharedTopologyType) -> None:
def __build_body_from_response(self, response: dict) -> Body:
"""Build a body from a response dictionary coming out of the gRPC call.

Notes
-----
This is a completely private method and is intended to be
used only within the class. It handles the MasterBody and
Body creation, and addition to the component.

Parameters
----------
response : dict
Expand All @@ -521,6 +515,12 @@ def __build_body_from_response(self, response: dict) -> Body:
-------
Body
Body object.

Notes
-----
This is a completely private method and is intended to be
used only within the class. It handles the MasterBody and
Body creation, and addition to the component.
"""
tb = MasterBody(
response["master_id"],
Expand Down Expand Up @@ -1102,10 +1102,6 @@ def __create_beams_legacy(
) -> list[Beam]:
"""Create beams under the component.

Notes
-----
This is a legacy method, which is used in versions up to Ansys 25.1.1 products.

Parameters
----------
segments : list[tuple[Point3D, Point3D]]
Expand All @@ -1117,6 +1113,10 @@ def __create_beams_legacy(
-------
list[Beam]
A list of the created Beams.

Notes
-----
This is a legacy method, which is used in versions up to Ansys 25.1.1 products.
"""
request = CreateBeamSegmentsRequest(parent=self.id, profile=profile.id)

Expand Down
10 changes: 5 additions & 5 deletions src/ansys/geometry/core/designer/design.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,11 +321,6 @@ def download(
def __export_and_download_legacy(self, format: DesignFileFormat) -> bytes:
"""Export and download the design from the server.

Notes
-----
This is a legacy method, which is used in versions
up to Ansys 25.1.1 products.

Parameters
----------
format : DesignFileFormat
Expand All @@ -335,6 +330,11 @@ def __export_and_download_legacy(self, format: DesignFileFormat) -> bytes:
-------
bytes
The raw data from the exported and downloaded file.

Notes
-----
This is a legacy method, which is used in versions
up to Ansys 25.1.1 products.
"""
# Process response
self._grpc_client.log.debug(f"Requesting design download in {format.value[0]} format.")
Expand Down
10 changes: 5 additions & 5 deletions src/ansys/geometry/core/designer/face.py
Original file line number Diff line number Diff line change
Expand Up @@ -556,15 +556,15 @@ def tessellate(self, tess_options: TessellationOptions | None = None) -> "pv.Pol
tess_options : TessellationOptions | None, default: None
A set of options to determine the tessellation quality.

Notes
-----
The tessellation options are ONLY used if the face has not been tessellated before.
If the face has been tessellated before, the stored tessellation is returned.

Returns
-------
~pyvista.PolyData
:class:`pyvista.PolyData` object holding the face.

Notes
-----
The tessellation options are ONLY used if the face has not been tessellated before.
If the face has been tessellated before, the stored tessellation is returned.
"""
# If tessellation has not been called before... call it
if self._body._template._tessellation is None:
Expand Down
Loading
Loading