Skip to content

Commit

Permalink
Merge branch 'blitz' into feat/commands_for_merge_and_intersect
Browse files Browse the repository at this point in the history
  • Loading branch information
smereu committed Jan 28, 2025
2 parents 8e723a1 + 1bb39e5 commit 846e8df
Show file tree
Hide file tree
Showing 35 changed files with 406 additions and 90 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/nightly_docker_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,7 @@ jobs:
name: Windows Core Service
needs: manifests
if: needs.manifests.outputs.skip_core_windows == 0
# runs-on: [self-hosted, Windows, pygeometry]
runs-on: # TODO: Waiting for ansys-network runner to be updated
group: pyansys-self-hosted
labels: [self-hosted, Windows, pygeometry]
runs-on: [self-hosted, Windows, pygeometry]
env:
PYVISTA_OFF_SCREEN: true
steps:
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ exclude: "tests/integration/files"
repos:

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.9.1
rev: v0.9.3
hooks:
- id: ruff
- id: ruff-format

- repo: https://github.com/codespell-project/codespell
rev: v2.3.0
rev: v2.4.0
hooks:
- id: codespell
args: ["--ignore-words", "doc/styles/config/vocabularies/ANSYS/accept.txt", "-w"]
Expand All @@ -27,7 +27,7 @@ repos:
- id: trailing-whitespace

- repo: https://github.com/ansys/pre-commit-hooks
rev: v0.4.4
rev: v0.5.1
hooks:
- id: add-license-headers
args:
Expand Down
1 change: 1 addition & 0 deletions doc/changelog.d/1659.maintenance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
reverting semver package whitelist since problematic version is yanked
1 change: 1 addition & 0 deletions doc/changelog.d/1662.dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bump numpy from 2.2.1 to 2.2.2
1 change: 1 addition & 0 deletions doc/changelog.d/1663.dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bump ansys-api-geometry from 0.4.30 to 0.4.31
1 change: 1 addition & 0 deletions doc/changelog.d/1667.maintenance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pre-commit automatic update
1 change: 1 addition & 0 deletions doc/changelog.d/1681.dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bump ansys-api-geometry from 0.4.31 to 0.4.32
1 change: 1 addition & 0 deletions doc/changelog.d/1682.dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bump panel from 1.5.5 to 1.6.0
1 change: 1 addition & 0 deletions doc/changelog.d/1687.dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bump semver from 3.0.2 to 3.0.4
1 change: 1 addition & 0 deletions doc/changelog.d/1689.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
matrix rotation and translation
1 change: 1 addition & 0 deletions doc/changelog.d/1691.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
disable unimplemented tests
1 change: 1 addition & 0 deletions doc/changelog.d/1692.added.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
is_core_service BackendType static method
1 change: 1 addition & 0 deletions doc/changelog.d/1693.maintenance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use dedicate pygeometry-ci-2 runner
1 change: 1 addition & 0 deletions doc/changelog.d/1695.dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
bump ansys-api-geometry from 0.4.32 to 0.4.33
1 change: 1 addition & 0 deletions doc/changelog.d/1696.maintenance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pre-commit automatic update
17 changes: 12 additions & 5 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,23 +57,30 @@ def get_wheelhouse_assets_dictionary():
time.sleep(2)

if content is None:
raise requests.exceptions.RequestException("Failed to retrieve the latest release.")

# Just point to the latest version
assets_context_version = json.loads(content)["name"]
print("Adapting URL to point to the latest version... (hack)")
assets_context_version = "dev"
else:
# Just point to the latest version
assets_context_version = json.loads(content)["name"]
else:
assets_context_version = f"v{__version__}"

assets = {}
for assets_os, assets_runner in zip(assets_context_os, assets_context_runners):
download_links = []
for assets_py_ver in assets_context_python_versions:
if assets_context_version == "dev":
prefix_url = "https://github.com/ansys/pyansys-geometry/releases/latest/download"
else:
prefix_url = (
f"https://github.com/ansys/pyansys-geometry/releases/download/{assets_context_version}",
)
temp_dict = {
"os": assets_os,
"runner": assets_runner,
"python_versions": assets_py_ver,
"latest_released_version": assets_context_version,
"prefix_url": f"https://github.com/ansys/pyansys-geometry/releases/download/{assets_context_version}", # noqa: E501
"prefix_url": prefix_url,
}
download_links.append(temp_dict)

Expand Down
12 changes: 6 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ classifiers = [
]

dependencies = [
"ansys-api-geometry==0.4.32",
"ansys-api-geometry==0.4.33",
"ansys-tools-path>=0.3,<1",
"ansys-tools-visualization-interface>=0.2.6,<1",
"attrs!=24.3.0",
Expand Down Expand Up @@ -58,7 +58,7 @@ tests = [
"geomdl==5.3.1",
"grpcio==1.67.1",
"grpcio-health-checking==1.67.1",
"numpy==2.2.1",
"numpy==2.2.2",
"Pint==0.24.4",
"protobuf==5.29.3",
"pytest==8.3.4",
Expand All @@ -68,7 +68,7 @@ tests = [
"pyvista[jupyter]==0.44.2",
"requests==2.32.3",
"scipy==1.15.1",
"semver==3.0.2",
"semver==3.0.4",
"six==1.17.0",
"vtk==9.3.1",
]
Expand All @@ -95,14 +95,14 @@ doc = [
"nbsphinx==0.9.6",
"notebook==7.3.2",
"numpydoc==1.8.0",
"numpy==2.2.1",
"panel==1.5.5",
"numpy==2.2.2",
"panel==1.6.0",
"Pint==0.24.4",
"protobuf==5.29.3",
"pyvista[jupyter]==0.44.2",
"requests==2.32.3",
"scipy==1.15.1",
"semver==3.0.2",
"semver==3.0.4",
"six==1.17.0",
"sphinx==8.1.3",
"sphinx-autodoc-typehints==3.0.1",
Expand Down
23 changes: 23 additions & 0 deletions src/ansys/geometry/core/connection/backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,29 @@ class BackendType(Enum):
SPACECLAIM = 1
WINDOWS_SERVICE = 2
LINUX_SERVICE = 3
CORE_WINDOWS = 4
CORE_LINUX = 5
DISCOVERY_HEADLESS = 6

@staticmethod
def is_core_service(backend_type: "BackendType") -> bool:
"""Determine whether the backend is CoreService based or not.
Parameters
----------
backend_type : BackendType
The backend type to check whether or not it's a CoreService type.
Returns
-------
bool
True if the backend is CoreService based, False otherwise.
"""
return backend_type in (
BackendType.LINUX_SERVICE,
BackendType.CORE_WINDOWS,
BackendType.CORE_LINUX,
)


class ApiVersions(Enum):
Expand Down
17 changes: 16 additions & 1 deletion src/ansys/geometry/core/connection/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,11 +215,26 @@ def __init__(
backend_type = BackendType.WINDOWS_SERVICE
elif grpc_backend_type == GRPCBackendType.LINUX_DMS:
backend_type = BackendType.LINUX_SERVICE
elif grpc_backend_type == GRPCBackendType.CORE_SERVICE_LINUX:
backend_type = BackendType.CORE_LINUX
elif grpc_backend_type == GRPCBackendType.CORE_SERVICE_WINDOWS:
backend_type = BackendType.CORE_WINDOWS
elif grpc_backend_type == GRPCBackendType.DISCOVERY_HEADLESS:
backend_type = BackendType.DISCOVERY_HEADLESS

# Store the backend type
self._backend_type = backend_type
self._multiple_designs_allowed = (
False if backend_type in (BackendType.DISCOVERY, BackendType.LINUX_SERVICE) else True
False
if backend_type
in (
BackendType.DISCOVERY,
BackendType.LINUX_SERVICE,
BackendType.CORE_LINUX,
BackendType.CORE_WINDOWS,
BackendType.DISCOVERY_HEADLESS,
)
else True
)

# retrieve the backend version
Expand Down
7 changes: 5 additions & 2 deletions src/ansys/geometry/core/connection/product_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,10 @@ def prepare_and_start_backend(
"""
from ansys.geometry.core.modeler import Modeler

if os.name != "nt" and backend_type != BackendType.LINUX_SERVICE: # pragma: no cover
if os.name != "nt" and backend_type not in (
BackendType.LINUX_SERVICE,
BackendType.CORE_LINUX,
): # pragma: no cover
raise RuntimeError(
"Method 'prepare_and_start_backend' is only available on Windows."
"A Linux version is only available for the Core Geometry Service."
Expand Down Expand Up @@ -362,7 +365,7 @@ def prepare_and_start_backend(
)
)
# This should be modified to Windows Core Service in the future
elif backend_type == BackendType.LINUX_SERVICE:
elif BackendType.is_core_service(backend_type):
# Define several Ansys Geometry Core Service folders needed
root_service_folder = Path(installations[product_version], CORE_GEOMETRY_SERVICE_FOLDER)
native_folder = root_service_folder / "Native"
Expand Down
Loading

0 comments on commit 846e8df

Please sign in to comment.