Skip to content

Rename DimensionType to PhysicalDimension #716

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 2 commits into from
Nov 28, 2024
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
10 changes: 5 additions & 5 deletions doc/source/api/enum_types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ Enumeration data types
CutOffGeometryOrientationType
CutOffMaterialHandling
CutOffRuleType
DimensionType
DrapingMaterialModel
DrapingType
DropOffMaterialHandling
Expand All @@ -26,6 +25,8 @@ Enumeration data types
ExtrusionType
FeFormat
GeometricalRuleType
HDF5CompositeCAEImportMode
HDF5CompositeCAEProjectionMode
IgnorableEntity
ImportedPlyDrapingType
ImportedPlyOffsetType
Expand All @@ -34,14 +35,11 @@ Enumeration data types
LayupMappingRosetteSelectionMethod
LinkedObjectHandling
LookUpTable3DInterpolationAlgorithm
HDF5CompositeCAEImportMode
HDF5CompositeCAEProjectionMode
LookUpTableColumnValueType
MeshImportType
NodalDataType
SolidModelOffsetDirectionType
OffsetType
SnapToGeometryOrientationType
PhysicalDimension
PlyCutOffType
PlyGeometryExportFormat
PlyType
Expand All @@ -50,8 +48,10 @@ Enumeration data types
RosetteType
SectionCutType
SensorType
SnapToGeometryOrientationType
SolidModelExportFormat
SolidModelImportFormat
SolidModelOffsetDirectionType
SolidModelSkinExportFormat
Status
StressStateType
Expand Down
4 changes: 2 additions & 2 deletions examples/modeling_features/03-advanced-selection-rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@
# Import the PyACP dependencies.
from ansys.acp.core import (
BooleanOperationType,
DimensionType,
EdgeSetType,
LinkedSelectionRule,
PhysicalDimension,
launch_acp,
)
from ansys.acp.core.extras import ExampleKeys, get_example_file
Expand Down Expand Up @@ -241,7 +241,7 @@
# Create the offset column that defines the offsets from the edge.
offsets_column = lookup_table.create_column(
name="offset",
dimension_type=DimensionType.LENGTH,
physical_dimension=PhysicalDimension.LENGTH,
data=np.array([0.00, 0.004, 0]),
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

# %%
# Import the PyACP dependencies.
from ansys.acp.core import DimensionType, ThicknessType, launch_acp
from ansys.acp.core import PhysicalDimension, ThicknessType, launch_acp
from ansys.acp.core.extras import FLAT_PLATE_SOLID_CAMERA, ExampleKeys, get_example_file

# sphinx_gallery_thumbnail_number = 2
Expand Down Expand Up @@ -166,7 +166,9 @@
# Create the lookup table and add the coordinates and thickness data.
lookup_table = model.create_lookup_table_3d()
lookup_table.columns["Location"].data = points
thickness_column = lookup_table.create_column(data=thickness, dimension_type=DimensionType.LENGTH)
thickness_column = lookup_table.create_column(
data=thickness, physical_dimension=PhysicalDimension.LENGTH
)

# %%
# Set the thickness type to ``FROM_TABLE`` and assign the thickness column.
Expand Down
8 changes: 4 additions & 4 deletions examples/modeling_features/06-ply-direction-lookup-table.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@
# %%
# Import the PyACP dependencies.
from ansys.acp.core import (
DimensionType,
DrapingType,
LookUpTableColumnValueType,
PhysicalDimension,
PlyType,
RosetteSelectionMethod,
get_directions_plotter,
Expand Down Expand Up @@ -147,7 +147,7 @@
lookup_table.columns["Location"].data = points
direction_column = lookup_table.create_column(
data=directions,
dimension_type=DimensionType.DIMENSIONLESS,
physical_dimension=PhysicalDimension.DIMENSIONLESS,
value_type=LookUpTableColumnValueType.DIRECTION,
)

Expand Down Expand Up @@ -177,7 +177,7 @@
correction_angle = np.arctan2(xx.ravel(), zz.ravel()) * 180 / np.pi
angle_column_1 = lookup_table.create_column(
data=correction_angle,
dimension_type=DimensionType.DIMENSIONLESS,
physical_dimension=PhysicalDimension.DIMENSIONLESS,
value_type=LookUpTableColumnValueType.SCALAR,
)

Expand All @@ -187,7 +187,7 @@
transverse_correction_angle = correction_angle + shear_angle
angle_column_2 = lookup_table.create_column(
data=transverse_correction_angle,
dimension_type=DimensionType.DIMENSIONLESS,
physical_dimension=PhysicalDimension.DIMENSIONLESS,
value_type=LookUpTableColumnValueType.SCALAR,
)

Expand Down
10 changes: 5 additions & 5 deletions src/ansys/acp/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
CutOffRuleType,
CutOffSelectionRule,
CylindricalSelectionRule,
DimensionType,
DrapingMaterialModel,
DrapingType,
DropOffMaterialHandling,
Expand Down Expand Up @@ -115,6 +114,7 @@
OffsetType,
OrientedSelectionSet,
ParallelSelectionRule,
PhysicalDimension,
PlyCutOffType,
PlyGeometryExportFormat,
PlyType,
Expand Down Expand Up @@ -179,9 +179,9 @@
"CutOffRuleType",
"CutOffSelectionRule",
"CylindricalSelectionRule",
"DimensionType",
"DirectLaunchConfig",
"DockerComposeLaunchConfig",
"dpf_integration_helpers",
"DrapingMaterialModel",
"DrapingType",
"DropOffMaterialHandling",
Expand Down Expand Up @@ -236,7 +236,7 @@
"material_property_sets",
"Material",
"mechanical_integration_helpers",
"dpf_integration_helpers",
"mesh_data",
"MeshImportType",
"Model",
"ModelingGroup",
Expand All @@ -245,9 +245,9 @@
"OffsetType",
"OrientedSelectionSet",
"ParallelSelectionRule",
"PhysicalDimension",
"PlyCutOffType",
"PlyGeometryExportFormat",
"SolidModelOffsetDirectionType",
"PlyType",
"PrimaryPly",
"print_model",
Expand All @@ -271,6 +271,7 @@
"SolidModelExportFormat",
"SolidModelExportSettings",
"SolidModelImportFormat",
"SolidModelOffsetDirectionType",
"SolidModelSkinExportFormat",
"SphericalSelectionRule",
"Stackup",
Expand All @@ -287,5 +288,4 @@
"VariableOffsetSelectionRule",
"VirtualGeometry",
"VirtualGeometryDimension",
"mesh_data",
]
6 changes: 3 additions & 3 deletions src/ansys/acp/core/_tree_objects/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
CutOffGeometryOrientationType,
CutOffMaterialHandling,
CutOffRuleType,
DimensionType,
DrapingMaterialModel,
DrapingType,
DropOffMaterialHandling,
Expand All @@ -72,6 +71,7 @@
MeshImportType,
NodalDataType,
OffsetType,
PhysicalDimension,
PlyCutOffType,
PlyGeometryExportFormat,
PlyType,
Expand Down Expand Up @@ -204,7 +204,6 @@
"CylindricalSelectionRule",
"CylindricalSelectionRuleElementalData",
"CylindricalSelectionRuleNodalData",
"DimensionType",
"DrapingMaterialModel",
"DrapingType",
"DropOffMaterialHandling",
Expand Down Expand Up @@ -268,14 +267,14 @@
"ModelingPlyNodalData",
"ModelNodalData",
"NodalDataType",
"SolidModelOffsetDirectionType",
"OffsetType",
"OrientedSelectionSet",
"OrientedSelectionSetElementalData",
"OrientedSelectionSetNodalData",
"ParallelSelectionRule",
"ParallelSelectionRuleElementalData",
"ParallelSelectionRuleNodalData",
"PhysicalDimension",
"PlyCutOffType",
"PlyGeometryExportFormat",
"PlyType",
Expand Down Expand Up @@ -307,6 +306,7 @@
"SolidModelExportSettings",
"SolidModelImportFormat",
"SolidModelNodalData",
"SolidModelOffsetDirectionType",
"SolidModelSkinExportFormat",
"SphericalSelectionRule",
"SphericalSelectionRuleElementalData",
Expand Down
18 changes: 9 additions & 9 deletions src/ansys/acp/core/_tree_objects/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,21 +49,18 @@

__all__ = [
"ArrowType",
"BaseElementMaterialHandling",
"BooleanOperationType",
"CutOffGeometryOrientationType",
"CutOffMaterialHandling",
"CutOffRuleType",
"DimensionType",
"DrapingMaterialModel",
"DrapingType",
"DropOffMaterialHandling",
"DropOffType",
"EdgeSetType",
"ElementalDataType",
"ElementTechnology",
"ReinforcingBehavior",
"BaseElementMaterialHandling",
"StressStateType",
"ExtrusionGuideType",
"ExtrusionMethod",
"ExtrusionType",
Expand All @@ -75,19 +72,22 @@
"LookUpTable3DInterpolationAlgorithm",
"LookUpTableColumnValueType",
"NodalDataType",
"SolidModelOffsetDirectionType",
"OffsetType",
"PhysicalDimension",
"PlyCutOffType",
"PlyGeometryExportFormat",
"PlyType",
"ReinforcingBehavior",
"RosetteSelectionMethod",
"RosetteType",
"SectionCutType",
"SensorType",
"SnapToGeometryOrientationType",
"SolidModelExportFormat",
"SolidModelOffsetDirectionType",
"SolidModelSkinExportFormat",
"Status",
"StressStateType",
"SymmetryType",
"ThicknessFieldType",
"ThicknessType",
Expand Down Expand Up @@ -256,11 +256,11 @@
)

(
DimensionType,
dimension_type_to_pb,
dimension_type_from_pb,
PhysicalDimension,
physical_dimension_to_pb,
physical_dimension_from_pb,
) = wrap_to_string_enum(
"DimensionType",
"PhysicalDimension",
unit_system_pb2.DimensionType,
module=__name__,
doc="Options for the dimension (time, length, currency, ...) of data.",
Expand Down
10 changes: 6 additions & 4 deletions src/ansys/acp/core/_tree_objects/lookup_table_1d_column.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from ansys.api.acp.v0 import lookup_table_1d_column_pb2, lookup_table_1d_column_pb2_grpc

from ._grpc_helpers.property_helper import mark_grpc_properties
from .enums import DimensionType, LookUpTableColumnValueType
from .enums import LookUpTableColumnValueType, PhysicalDimension
from .lookup_table_column_base import LookUpTableColumnBase
from .object_registry import register

Expand All @@ -49,7 +49,7 @@ class LookUpTable1DColumn(LookUpTableColumnBase):
directional (three entries per row).
Note that the ``value_type`` can only be set when constructing the
column, and is read-only afterwards.
dimension_type :
physical_dimension :
Dimensionality (such as time, length, force, ...) of the column data.
data :
The column data. The shape of the data must match the ``value_type``
Expand All @@ -69,10 +69,12 @@ def __init__(
*,
name: str = "LookUpTable1DColumn",
value_type: LookUpTableColumnValueType = LookUpTableColumnValueType.SCALAR,
dimension_type: DimensionType = DimensionType.DIMENSIONLESS,
physical_dimension: PhysicalDimension = PhysicalDimension.DIMENSIONLESS,
data: npt.NDArray[np.float64] | None = None,
):
super().__init__(name=name, value_type=value_type, dimension_type=dimension_type, data=data)
super().__init__(
name=name, value_type=value_type, physical_dimension=physical_dimension, data=data
)

def _create_stub(self) -> lookup_table_1d_column_pb2_grpc.ObjectServiceStub:
return lookup_table_1d_column_pb2_grpc.ObjectServiceStub(self._channel)
10 changes: 6 additions & 4 deletions src/ansys/acp/core/_tree_objects/lookup_table_3d_column.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from ansys.api.acp.v0 import lookup_table_3d_column_pb2, lookup_table_3d_column_pb2_grpc

from ._grpc_helpers.property_helper import mark_grpc_properties
from .enums import DimensionType, LookUpTableColumnValueType
from .enums import LookUpTableColumnValueType, PhysicalDimension
from .lookup_table_column_base import LookUpTableColumnBase
from .object_registry import register

Expand All @@ -49,7 +49,7 @@ class LookUpTable3DColumn(LookUpTableColumnBase):
directional (three entries per row).
Note that the ``value_type`` can only be set when constructing the
column, and is read-only afterwards.
dimension_type :
physical_dimension :
Dimensionality (such as time, length, force, ...) of the column data.
data :
The column data. The shape of the data must match the ``value_type``
Expand All @@ -69,10 +69,12 @@ def __init__(
*,
name: str = "LookUpTable3DColumn",
value_type: LookUpTableColumnValueType = LookUpTableColumnValueType.SCALAR,
dimension_type: DimensionType = DimensionType.DIMENSIONLESS,
physical_dimension: PhysicalDimension = PhysicalDimension.DIMENSIONLESS,
data: npt.NDArray[np.float64] | None = None,
):
super().__init__(name=name, value_type=value_type, dimension_type=dimension_type, data=data)
super().__init__(
name=name, value_type=value_type, physical_dimension=physical_dimension, data=data
)

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