Skip to content

Commit c11b69c

Browse files
committed
Merge branch 'main' into release/0.10
2 parents d234416 + 41eabee commit c11b69c

File tree

12 files changed

+110
-50
lines changed

12 files changed

+110
-50
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ exclude: "tests/integration/files"
77
repos:
88

99
- repo: https://github.com/astral-sh/ruff-pre-commit
10-
rev: v0.11.0
10+
rev: v0.11.2
1111
hooks:
1212
- id: ruff
1313
- id: ruff-format

doc/changelog.d/1861.maintenance.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
update CHANGELOG for v0.10.1

doc/changelog.d/1862.dependencies.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
bump beartype from 0.19.0 to 0.20.1

doc/changelog.d/1864.dependencies.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
bump beartype from 0.20.1 to 0.20.2

doc/changelog.d/1865.test.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
issue 1801

doc/changelog.d/1866.maintenance.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pre-commit automatic update

doc/changelog.d/1869.added.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
implement lazy loading of members in NamedSelection to speed up loading times when reading model

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ dependencies = [
2727
"ansys-api-geometry==0.4.50",
2828
"ansys-tools-path>=0.3,<1",
2929
"attrs!=24.3.0",
30-
"beartype>=0.11.0,<0.20",
30+
"beartype>=0.11.0,<0.21",
3131
"geomdl>=5,<6",
3232
"grpcio>=1.35.0,<1.68",
3333
"grpcio-health-checking>=1.45.0,<1.68",
@@ -60,7 +60,7 @@ tests = [
6060
"ansys-platform-instancemanagement==1.1.2",
6161
"ansys-tools-path==0.7.1",
6262
"ansys-tools-visualization-interface==0.8.3",
63-
"beartype==0.19.0",
63+
"beartype==0.20.2",
6464
"docker==7.1.0",
6565
"geomdl==5.3.1",
6666
"grpcio==1.67.1",
@@ -91,7 +91,7 @@ doc = [
9191
"ansys-sphinx-theme[autoapi]==1.3.3",
9292
"ansys-tools-path==0.7.1",
9393
"ansys-tools-visualization-interface==0.8.3",
94-
"beartype==0.19.0",
94+
"beartype==0.20.2",
9595
"docker==7.1.0",
9696
"geomdl==5.3.1",
9797
"grpcio==1.67.1",

src/ansys/geometry/core/designer/design.py

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,6 @@
8888
from ansys.geometry.core.math.plane import Plane
8989
from ansys.geometry.core.math.point import Point3D
9090
from ansys.geometry.core.math.vector import UnitVector3D, Vector3D
91-
from ansys.geometry.core.misc.auxiliary import (
92-
get_beams_from_ids,
93-
get_bodies_from_ids,
94-
get_edges_from_ids,
95-
get_faces_from_ids,
96-
)
9791
from ansys.geometry.core.misc.checks import ensure_design_is_active, min_backend_version
9892
from ansys.geometry.core.misc.measurements import DEFAULT_UNITS, Distance
9993
from ansys.geometry.core.misc.options import ImportOptions
@@ -687,6 +681,7 @@ def create_named_selection(
687681
"""
688682
named_selection = NamedSelection(
689683
name,
684+
self,
690685
self._grpc_client,
691686
bodies=bodies,
692687
faces=faces,
@@ -1214,29 +1209,11 @@ def __read_existing_design(self) -> None:
12141209

12151210
# Create NamedSelections
12161211
for ns in response.named_selections:
1217-
result = self._named_selections_stub.Get(EntityIdentifier(id=ns.id))
1218-
1219-
# This works but is slow -- can use improvement for designs with many named selections
1220-
bodies = get_bodies_from_ids(self, [body.id for body in result.bodies])
1221-
faces = get_faces_from_ids(self, [face.id for face in result.faces])
1222-
edges = get_edges_from_ids(self, [edge.id for edge in result.edges])
1223-
beams = get_beams_from_ids(self, [beam.id.id for beam in result.beams])
1224-
1225-
design_points = []
1226-
for dp in result.design_points:
1227-
design_points.append(
1228-
DesignPoint(dp.id, "dp: " + dp.id, grpc_point_to_point3d(dp.points[0]), self)
1229-
)
1230-
12311212
new_ns = NamedSelection(
12321213
ns.name,
1214+
self,
12331215
self._grpc_client,
12341216
preexisting_id=ns.id,
1235-
bodies=bodies,
1236-
faces=faces,
1237-
edges=edges,
1238-
beams=beams,
1239-
design_points=design_points,
12401217
)
12411218
self._named_selections[new_ns.name] = new_ns
12421219

src/ansys/geometry/core/designer/designpoint.py

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121
# SOFTWARE.
2222
"""Module for creating and managing design points."""
2323

24-
from typing import TYPE_CHECKING
24+
from typing import TYPE_CHECKING, Union
2525

2626
from ansys.geometry.core.math.point import Point3D
27-
from ansys.geometry.core.misc.checks import check_type, graphics_required
27+
from ansys.geometry.core.misc.checks import graphics_required
2828
from ansys.geometry.core.misc.units import UNITS
2929

3030
if TYPE_CHECKING: # pragma: no cover
@@ -44,19 +44,15 @@ class DesignPoint:
4444
User-defined label for the design points.
4545
points : Point3D
4646
3D point constituting the design points.
47-
parent_component : Component
47+
parent_component : Component | None
4848
Parent component to place the new design point under within the design assembly.
49+
Its default value is None.
4950
"""
5051

51-
def __init__(self, id: str, name: str, point: Point3D, parent_component: "Component"):
52+
def __init__(
53+
self, id: str, name: str, point: Point3D, parent_component: Union["Component", None] = None
54+
):
5255
"""Initialize the ``DesignPoints`` class."""
53-
from ansys.geometry.core.designer.component import Component
54-
55-
check_type(id, str)
56-
check_type(name, str)
57-
check_type(point, Point3D)
58-
check_type(parent_component, Component)
59-
6056
self._id = id
6157
self._name = name
6258
self._value = point

0 commit comments

Comments
 (0)