Skip to content

Commit 1ad320b

Browse files
committed
Rename DimensionType to PhysicalDimension
1 parent d440904 commit 1ad320b

File tree

11 files changed

+51
-45
lines changed

11 files changed

+51
-45
lines changed

doc/source/api/enum_types.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Enumeration data types
1313
CutOffGeometryOrientationType
1414
CutoffMaterialHandling
1515
CutoffRuleType
16-
DimensionType
16+
PhysicalDimension
1717
DrapingMaterialModel
1818
DrapingType
1919
DropoffMaterialHandling

examples/modeling_features/03-advanced-selection-rules.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@
5151
# Import the PyACP dependencies.
5252
from ansys.acp.core import (
5353
BooleanOperationType,
54-
DimensionType,
5554
EdgeSetType,
5655
LinkedSelectionRule,
56+
PhysicalDimension,
5757
launch_acp,
5858
)
5959
from ansys.acp.core.extras import ExampleKeys, get_example_file
@@ -241,7 +241,7 @@
241241
# Create the offset column that defines the offsets from the edge.
242242
offsets_column = lookup_table.create_column(
243243
name="offset",
244-
dimension_type=DimensionType.LENGTH,
244+
physical_dimension=PhysicalDimension.LENGTH,
245245
data=np.array([0.00, 0.004, 0]),
246246
)
247247

examples/modeling_features/04-layup-thickness-definitions.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545

4646
# %%
4747
# Import the PyACP dependencies.
48-
from ansys.acp.core import DimensionType, ThicknessType, launch_acp
48+
from ansys.acp.core import PhysicalDimension, ThicknessType, launch_acp
4949
from ansys.acp.core.extras import ExampleKeys, get_example_file
5050

5151
# sphinx_gallery_thumbnail_number = 2
@@ -166,7 +166,9 @@
166166
# Create the lookup table and add the coordinates and thickness data.
167167
lookup_table = model.create_lookup_table_3d()
168168
lookup_table.columns["Location"].data = points
169-
thickness_column = lookup_table.create_column(data=thickness, dimension_type=DimensionType.LENGTH)
169+
thickness_column = lookup_table.create_column(
170+
data=thickness, physical_dimension=PhysicalDimension.LENGTH
171+
)
170172

171173
# %%
172174
# Set the thickness type to ``FROM_TABLE`` and assign the thickness column.

examples/modeling_features/06-ply-direction-lookup-table.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@
4545
# %%
4646
# Import the PyACP dependencies.
4747
from ansys.acp.core import (
48-
DimensionType,
4948
DrapingType,
5049
LookUpTableColumnValueType,
50+
PhysicalDimension,
5151
PlyType,
5252
RosetteSelectionMethod,
5353
get_directions_plotter,
@@ -147,7 +147,7 @@
147147
lookup_table.columns["Location"].data = points
148148
direction_column = lookup_table.create_column(
149149
data=directions,
150-
dimension_type=DimensionType.DIMENSIONLESS,
150+
physical_dimension=PhysicalDimension.DIMENSIONLESS,
151151
value_type=LookUpTableColumnValueType.DIRECTION,
152152
)
153153

@@ -177,7 +177,7 @@
177177
correction_angle = np.arctan2(xx.ravel(), zz.ravel()) * 180 / np.pi
178178
angle_column_1 = lookup_table.create_column(
179179
data=correction_angle,
180-
dimension_type=DimensionType.DIMENSIONLESS,
180+
physical_dimension=PhysicalDimension.DIMENSIONLESS,
181181
value_type=LookUpTableColumnValueType.SCALAR,
182182
)
183183

@@ -187,7 +187,7 @@
187187
transverse_correction_angle = correction_angle + shear_angle
188188
angle_column_2 = lookup_table.create_column(
189189
data=transverse_correction_angle,
190-
dimension_type=DimensionType.DIMENSIONLESS,
190+
physical_dimension=PhysicalDimension.DIMENSIONLESS,
191191
value_type=LookUpTableColumnValueType.SCALAR,
192192
)
193193

src/ansys/acp/core/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@
6161
CutoffRuleType,
6262
CutoffSelectionRule,
6363
CylindricalSelectionRule,
64-
DimensionType,
6564
DrapingMaterialModel,
6665
DrapingType,
6766
DropoffMaterialHandling,
@@ -115,6 +114,7 @@
115114
OffsetType,
116115
OrientedSelectionSet,
117116
ParallelSelectionRule,
117+
PhysicalDimension,
118118
PlyCutoffType,
119119
PlyGeometryExportFormat,
120120
PlyType,
@@ -179,9 +179,9 @@
179179
"CutoffRuleType",
180180
"CutoffSelectionRule",
181181
"CylindricalSelectionRule",
182-
"DimensionType",
183182
"DirectLaunchConfig",
184183
"DockerComposeLaunchConfig",
184+
"dpf_integration_helpers",
185185
"DrapingMaterialModel",
186186
"DrapingType",
187187
"DropoffMaterialHandling",
@@ -236,7 +236,7 @@
236236
"material_property_sets",
237237
"Material",
238238
"mechanical_integration_helpers",
239-
"dpf_integration_helpers",
239+
"mesh_data",
240240
"MeshImportType",
241241
"Model",
242242
"ModelingGroup",
@@ -245,9 +245,9 @@
245245
"OffsetType",
246246
"OrientedSelectionSet",
247247
"ParallelSelectionRule",
248+
"PhysicalDimension",
248249
"PlyCutoffType",
249250
"PlyGeometryExportFormat",
250-
"SolidModelOffsetDirectionType",
251251
"PlyType",
252252
"PrimaryPly",
253253
"print_model",
@@ -271,6 +271,7 @@
271271
"SolidModelExportFormat",
272272
"SolidModelExportSettings",
273273
"SolidModelImportFormat",
274+
"SolidModelOffsetDirectionType",
274275
"SolidModelSkinExportFormat",
275276
"SphericalSelectionRule",
276277
"Stackup",
@@ -287,5 +288,4 @@
287288
"VariableOffsetSelectionRule",
288289
"VirtualGeometry",
289290
"VirtualGeometryDimension",
290-
"mesh_data",
291291
]

src/ansys/acp/core/_tree_objects/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
CutOffGeometryOrientationType,
5252
CutoffMaterialHandling,
5353
CutoffRuleType,
54-
DimensionType,
5554
DrapingMaterialModel,
5655
DrapingType,
5756
DropoffMaterialHandling,
@@ -72,6 +71,7 @@
7271
MeshImportType,
7372
NodalDataType,
7473
OffsetType,
74+
PhysicalDimension,
7575
PlyCutoffType,
7676
PlyGeometryExportFormat,
7777
PlyType,
@@ -204,7 +204,6 @@
204204
"CylindricalSelectionRule",
205205
"CylindricalSelectionRuleElementalData",
206206
"CylindricalSelectionRuleNodalData",
207-
"DimensionType",
208207
"DrapingMaterialModel",
209208
"DrapingType",
210209
"DropoffMaterialHandling",
@@ -268,14 +267,14 @@
268267
"ModelingPlyNodalData",
269268
"ModelNodalData",
270269
"NodalDataType",
271-
"SolidModelOffsetDirectionType",
272270
"OffsetType",
273271
"OrientedSelectionSet",
274272
"OrientedSelectionSetElementalData",
275273
"OrientedSelectionSetNodalData",
276274
"ParallelSelectionRule",
277275
"ParallelSelectionRuleElementalData",
278276
"ParallelSelectionRuleNodalData",
277+
"PhysicalDimension",
279278
"PlyCutoffType",
280279
"PlyGeometryExportFormat",
281280
"PlyType",
@@ -307,6 +306,7 @@
307306
"SolidModelExportSettings",
308307
"SolidModelImportFormat",
309308
"SolidModelNodalData",
309+
"SolidModelOffsetDirectionType",
310310
"SolidModelSkinExportFormat",
311311
"SphericalSelectionRule",
312312
"SphericalSelectionRuleElementalData",

src/ansys/acp/core/_tree_objects/enums.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"CutOffGeometryOrientationType",
5454
"CutoffMaterialHandling",
5555
"CutoffRuleType",
56-
"DimensionType",
56+
"PhysicalDimension",
5757
"DrapingMaterialModel",
5858
"DrapingType",
5959
"DropoffMaterialHandling",
@@ -256,11 +256,11 @@
256256
)
257257

258258
(
259-
DimensionType,
260-
dimension_type_to_pb,
261-
dimension_type_from_pb,
259+
PhysicalDimension,
260+
physical_dimension_to_pb,
261+
physical_dimension_from_pb,
262262
) = wrap_to_string_enum(
263-
"DimensionType",
263+
"PhysicalDimension",
264264
unit_system_pb2.DimensionType,
265265
module=__name__,
266266
doc="Options for the dimension (time, length, currency, ...) of data.",

src/ansys/acp/core/_tree_objects/lookup_table_1d_column.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
from ansys.api.acp.v0 import lookup_table_1d_column_pb2, lookup_table_1d_column_pb2_grpc
3131

3232
from ._grpc_helpers.property_helper import mark_grpc_properties
33-
from .enums import DimensionType, LookUpTableColumnValueType
33+
from .enums import LookUpTableColumnValueType, PhysicalDimension
3434
from .lookup_table_column_base import LookUpTableColumnBase
3535
from .object_registry import register
3636

@@ -49,7 +49,7 @@ class LookUpTable1DColumn(LookUpTableColumnBase):
4949
directional (three entries per row).
5050
Note that the ``value_type`` can only be set when constructing the
5151
column, and is read-only afterwards.
52-
dimension_type :
52+
physical_dimension :
5353
Dimensionality (such as time, length, force, ...) of the column data.
5454
data :
5555
The column data. The shape of the data must match the ``value_type``
@@ -69,10 +69,12 @@ def __init__(
6969
*,
7070
name: str = "LookUpTable1DColumn",
7171
value_type: LookUpTableColumnValueType = LookUpTableColumnValueType.SCALAR,
72-
dimension_type: DimensionType = DimensionType.DIMENSIONLESS,
72+
physical_dimension: PhysicalDimension = PhysicalDimension.DIMENSIONLESS,
7373
data: npt.NDArray[np.float64] | None = None,
7474
):
75-
super().__init__(name=name, value_type=value_type, dimension_type=dimension_type, data=data)
75+
super().__init__(
76+
name=name, value_type=value_type, physical_dimension=physical_dimension, data=data
77+
)
7678

7779
def _create_stub(self) -> lookup_table_1d_column_pb2_grpc.ObjectServiceStub:
7880
return lookup_table_1d_column_pb2_grpc.ObjectServiceStub(self._channel)

src/ansys/acp/core/_tree_objects/lookup_table_3d_column.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
from ansys.api.acp.v0 import lookup_table_3d_column_pb2, lookup_table_3d_column_pb2_grpc
3131

3232
from ._grpc_helpers.property_helper import mark_grpc_properties
33-
from .enums import DimensionType, LookUpTableColumnValueType
33+
from .enums import LookUpTableColumnValueType, PhysicalDimension
3434
from .lookup_table_column_base import LookUpTableColumnBase
3535
from .object_registry import register
3636

@@ -49,7 +49,7 @@ class LookUpTable3DColumn(LookUpTableColumnBase):
4949
directional (three entries per row).
5050
Note that the ``value_type`` can only be set when constructing the
5151
column, and is read-only afterwards.
52-
dimension_type :
52+
physical_dimension :
5353
Dimensionality (such as time, length, force, ...) of the column data.
5454
data :
5555
The column data. The shape of the data must match the ``value_type``
@@ -69,10 +69,12 @@ def __init__(
6969
*,
7070
name: str = "LookUpTable3DColumn",
7171
value_type: LookUpTableColumnValueType = LookUpTableColumnValueType.SCALAR,
72-
dimension_type: DimensionType = DimensionType.DIMENSIONLESS,
72+
physical_dimension: PhysicalDimension = PhysicalDimension.DIMENSIONLESS,
7373
data: npt.NDArray[np.float64] | None = None,
7474
):
75-
super().__init__(name=name, value_type=value_type, dimension_type=dimension_type, data=data)
75+
super().__init__(
76+
name=name, value_type=value_type, physical_dimension=physical_dimension, data=data
77+
)
7678

7779
def _create_stub(self) -> lookup_table_3d_column_pb2_grpc.ObjectServiceStub:
7880
return lookup_table_3d_column_pb2_grpc.ObjectServiceStub(self._channel)

src/ansys/acp/core/_tree_objects/lookup_table_column_base.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,12 @@
3737
)
3838
from .base import CreatableTreeObject, IdTreeObject
3939
from .enums import (
40-
DimensionType,
4140
LookUpTableColumnValueType,
42-
dimension_type_from_pb,
43-
dimension_type_to_pb,
41+
PhysicalDimension,
4442
lookup_table_column_value_type_from_pb,
4543
lookup_table_column_value_type_to_pb,
44+
physical_dimension_from_pb,
45+
physical_dimension_to_pb,
4646
)
4747

4848
__all__ = ["LookUpTableColumnBase"]
@@ -59,7 +59,7 @@ class LookUpTableColumnBase(CreatableTreeObject, IdTreeObject):
5959
directional (three entries per row).
6060
Note that the ``value_type`` can only be set when constructing the
6161
column, and is read-only afterwards.
62-
dimension_type :
62+
physical_dimension :
6363
Dimensionality (such as time, length, force, ...) of the column data.
6464
data :
6565
The column data. The shape of the data must match the ``value_type``
@@ -74,7 +74,7 @@ def __init__(
7474
*,
7575
name: str,
7676
value_type: LookUpTableColumnValueType = LookUpTableColumnValueType.SCALAR,
77-
dimension_type: DimensionType = DimensionType.DIMENSIONLESS,
77+
physical_dimension: PhysicalDimension = PhysicalDimension.DIMENSIONLESS,
7878
data: npt.NDArray[np.float64] | None = None,
7979
):
8080
super().__init__(name=name)
@@ -88,17 +88,17 @@ def __init__(
8888
self, value_type
8989
)
9090

91-
self.dimension_type = dimension_type
91+
self.physical_dimension = physical_dimension
9292
if data is not None:
9393
self.data = data
9494

9595
value_type = grpc_data_property_read_only(
9696
"properties.value_type", from_protobuf=lookup_table_column_value_type_from_pb
9797
)
98-
dimension_type = grpc_data_property(
98+
physical_dimension = grpc_data_property(
9999
"properties.dimension_type",
100-
from_protobuf=dimension_type_from_pb,
101-
to_protobuf=dimension_type_to_pb,
100+
from_protobuf=physical_dimension_from_pb,
101+
to_protobuf=physical_dimension_to_pb,
102102
)
103103
data: ReadWriteProperty[npt.NDArray[np.float64], npt.NDArray[np.float64]] = grpc_data_property(
104104
"properties.data",

tests/unittests/test_lookup_table_column.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626
import pytest
2727

2828
from ansys.acp.core import (
29-
DimensionType,
3029
LookUpTable1DColumn,
3130
LookUpTable3DColumn,
3231
LookUpTableColumnValueType,
32+
PhysicalDimension,
3333
)
3434

3535
from .common.tree_object_tester import (
@@ -115,7 +115,7 @@ class TestLookUpTableColumn(WithLockedMixin, TreeObjectTester):
115115
def default_properties(default_data):
116116
return {
117117
"value_type": LookUpTableColumnValueType.SCALAR,
118-
"dimension_type": DimensionType.DIMENSIONLESS,
118+
"physical_dimension": PhysicalDimension.DIMENSIONLESS,
119119
"data": default_data,
120120
}
121121

@@ -128,9 +128,9 @@ def object_properties(column_data, column_value_type):
128128
read_write=[
129129
("name", "some_name"),
130130
("data", column_data),
131-
("dimension_type", DimensionType.TIME),
132-
("dimension_type", DimensionType.CURRENCY),
133-
("dimension_type", DimensionType.MASS),
131+
("physical_dimension", PhysicalDimension.TIME),
132+
("physical_dimension", PhysicalDimension.CURRENCY),
133+
("physical_dimension", PhysicalDimension.MASS),
134134
],
135135
read_only=[
136136
("id", "some_id"),
@@ -141,7 +141,7 @@ def object_properties(column_data, column_value_type):
141141
{
142142
"name": "some_name",
143143
"data": column_data,
144-
"dimension_type": DimensionType.TIME,
144+
"physical_dimension": PhysicalDimension.TIME,
145145
"value_type": column_value_type,
146146
}
147147
],

0 commit comments

Comments
 (0)