From b1321ad82dcbfdc83657b8264c1fd18a847a74c1 Mon Sep 17 00:00:00 2001 From: Dominik Gresch Date: Thu, 7 Nov 2024 09:39:04 +0100 Subject: [PATCH] Harmonize enum and enum-parameter names (#659) Align the names of enum and the names of the respective parameters. Closes #658 --- doc/source/api/enum_types.rst | 12 ++--- examples/007_direction_definitions.py | 2 +- src/ansys/acp/core/__init__.py | 24 +++++----- src/ansys/acp/core/_tree_objects/__init__.py | 24 +++++----- .../_tree_objects/_grpc_helpers/mapping.py | 4 +- .../_tree_objects/boolean_selection_rule.py | 10 ++--- .../cylindrical_selection_rule.py | 18 ++++---- src/ansys/acp/core/_tree_objects/enums.py | 44 +++++++++---------- src/ansys/acp/core/_tree_objects/fabric.py | 18 ++++---- .../geometrical_selection_rule.py | 10 ++--- .../_tree_objects/imported_modeling_ply.py | 8 ++-- .../acp/core/_tree_objects/modeling_ply.py | 8 ++-- .../_tree_objects/oriented_selection_set.py | 8 ++-- .../_tree_objects/parallel_selection_rule.py | 18 ++++---- .../acp/core/_tree_objects/solid_model.py | 14 +++--- .../_tree_objects/spherical_selection_rule.py | 18 ++++---- src/ansys/acp/core/_tree_objects/stackup.py | 18 ++++---- .../core/_tree_objects/tube_selection_rule.py | 10 ++--- .../variable_offset_selection_rule.py | 10 ++--- .../unittests/test_boolean_selection_rule.py | 4 +- .../test_cylindrical_selection_rule.py | 8 ++-- tests/unittests/test_fabric.py | 30 ++++++------- .../test_geometrical_selection_rule.py | 4 +- tests/unittests/test_imported_modeling_ply.py | 4 +- tests/unittests/test_modeling_ply.py | 2 +- .../unittests/test_parallel_selection_rule.py | 8 ++-- tests/unittests/test_solid_model.py | 4 +- .../test_spherical_selection_rule.py | 8 ++-- tests/unittests/test_stackup.py | 18 ++++---- tests/unittests/test_tube_selection_rule.py | 4 +- .../test_variable_offset_selection_rule.py | 4 +- 31 files changed, 180 insertions(+), 196 deletions(-) diff --git a/doc/source/api/enum_types.rst b/doc/source/api/enum_types.rst index 23125ba507..9ebc074a24 100644 --- a/doc/source/api/enum_types.rst +++ b/doc/source/api/enum_types.rst @@ -11,18 +11,18 @@ Enumeration data types BaseElementMaterialHandling BooleanOperationType CutOffGeometryOrientationType - CutoffMaterialType + CutoffMaterialHandling CutoffRuleType DimensionType - DrapingMaterialType + DrapingMaterialModel DrapingType - DropoffMaterialType + DropoffMaterialHandling DropOffType EdgeSetType ElementalDataType ElementTechnology ExtrusionGuideType - ExtrusionMethodType + ExtrusionMethod ExtrusionType FeFormat GeometricalRuleType @@ -37,7 +37,7 @@ Enumeration data types LookUpTableColumnValueType MeshImportType NodalDataType - OffsetDirectionType + SolidModelOffsetDirectionType OffsetType SnapToGeometryOrientationType PlyCutoffType @@ -51,7 +51,7 @@ Enumeration data types SolidModelExportFormat SolidModelImportFormat SolidModelSkinExportFormat - StatusType + Status StressStateType SymmetryType ThicknessFieldType diff --git a/examples/007_direction_definitions.py b/examples/007_direction_definitions.py index 45947cac65..f4a0084525 100644 --- a/examples/007_direction_definitions.py +++ b/examples/007_direction_definitions.py @@ -208,7 +208,7 @@ ply_angle=0, ply_material=fabric, oriented_selection_sets=[oss], - draping=DrapingType.TABULAR_VALUES, + draping_type=DrapingType.TABULAR_VALUES, draping_angle_1_field=angle_column_1, draping_angle_2_field=angle_column_2, ) diff --git a/src/ansys/acp/core/__init__.py b/src/ansys/acp/core/__init__.py index 54c33f677d..4e5f2e1605 100644 --- a/src/ansys/acp/core/__init__.py +++ b/src/ansys/acp/core/__init__.py @@ -54,7 +54,7 @@ CADGeometry, CutOffGeometry, CutOffGeometryOrientationType, - CutoffMaterialType, + CutoffMaterialHandling, CutoffRuleType, CutoffSelectionRule, CutoffSelectionRuleElementalData, @@ -63,9 +63,9 @@ CylindricalSelectionRuleElementalData, CylindricalSelectionRuleNodalData, DimensionType, - DrapingMaterialType, + DrapingMaterialModel, DrapingType, - DropoffMaterialType, + DropoffMaterialHandling, DropOffSettings, DropOffType, EdgeSet, @@ -77,7 +77,7 @@ ElementTechnology, ExtrusionGuide, ExtrusionGuideType, - ExtrusionMethodType, + ExtrusionMethod, ExtrusionType, Fabric, FabricWithAngle, @@ -122,7 +122,6 @@ ModelingPlyNodalData, ModelNodalData, NodalDataType, - OffsetDirectionType, OffsetType, OrientedSelectionSet, OrientedSelectionSetElementalData, @@ -158,12 +157,13 @@ SolidModelExportSettings, SolidModelImportFormat, SolidModelNodalData, + SolidModelOffsetDirectionType, SolidModelSkinExportFormat, SphericalSelectionRule, SphericalSelectionRuleElementalData, SphericalSelectionRuleNodalData, Stackup, - StatusType, + Status, StressStateType, SubLaminate, SubShape, @@ -207,7 +207,7 @@ "ConnectLaunchConfig", "CutOffGeometry", "CutOffGeometryOrientationType", - "CutoffMaterialType", + "CutoffMaterialHandling", "CutoffRuleType", "CutoffSelectionRule", "CutoffSelectionRuleElementalData", @@ -218,9 +218,9 @@ "DimensionType", "DirectLaunchConfig", "DockerComposeLaunchConfig", - "DrapingMaterialType", + "DrapingMaterialModel", "DrapingType", - "DropoffMaterialType", + "DropoffMaterialHandling", "DropOffSettings", "DropOffType", "EdgeSet", @@ -233,7 +233,7 @@ "example_helpers", "ExtrusionGuide", "ExtrusionGuideType", - "ExtrusionMethodType", + "ExtrusionMethod", "ExtrusionType", "Fabric", "FabricWithAngle", @@ -286,7 +286,7 @@ "ModelingPlyNodalData", "ModelNodalData", "NodalDataType", - "OffsetDirectionType", + "SolidModelOffsetDirectionType", "OffsetType", "OrientedSelectionSet", "OrientedSelectionSetElementalData", @@ -329,7 +329,7 @@ "SphericalSelectionRuleElementalData", "SphericalSelectionRuleNodalData", "Stackup", - "StatusType", + "Status", "StressStateType", "SubLaminate", "SubShape", diff --git a/src/ansys/acp/core/_tree_objects/__init__.py b/src/ansys/acp/core/_tree_objects/__init__.py index 34c560286a..cf8c088e22 100644 --- a/src/ansys/acp/core/_tree_objects/__init__.py +++ b/src/ansys/acp/core/_tree_objects/__init__.py @@ -48,18 +48,18 @@ BaseElementMaterialHandling, BooleanOperationType, CutOffGeometryOrientationType, - CutoffMaterialType, + CutoffMaterialHandling, CutoffRuleType, DimensionType, - DrapingMaterialType, + DrapingMaterialModel, DrapingType, - DropoffMaterialType, + DropoffMaterialHandling, DropOffType, EdgeSetType, ElementalDataType, ElementTechnology, ExtrusionGuideType, - ExtrusionMethodType, + ExtrusionMethod, ExtrusionType, GeometricalRuleType, ImportedPlyDrapingType, @@ -70,7 +70,6 @@ LookUpTableColumnValueType, MeshImportType, NodalDataType, - OffsetDirectionType, OffsetType, PlyCutoffType, PlyGeometryExportFormat, @@ -82,8 +81,9 @@ SensorType, SnapToGeometryOrientationType, SolidModelExportFormat, + SolidModelOffsetDirectionType, SolidModelSkinExportFormat, - StatusType, + Status, StressStateType, SymmetryType, ThicknessFieldType, @@ -183,7 +183,7 @@ "CADGeometry", "CutOffGeometry", "CutOffGeometryOrientationType", - "CutoffMaterialType", + "CutoffMaterialHandling", "CutoffRuleType", "CutoffSelectionRule", "CutoffSelectionRuleElementalData", @@ -192,9 +192,9 @@ "CylindricalSelectionRuleElementalData", "CylindricalSelectionRuleNodalData", "DimensionType", - "DrapingMaterialType", + "DrapingMaterialModel", "DrapingType", - "DropoffMaterialType", + "DropoffMaterialHandling", "DropOffSettings", "DropOffType", "EdgeSet", @@ -206,7 +206,7 @@ "ElementTechnology", "ExtrusionGuide", "ExtrusionGuideType", - "ExtrusionMethodType", + "ExtrusionMethod", "ExtrusionType", "Fabric", "FabricWithAngle", @@ -253,7 +253,7 @@ "ModelingPlyNodalData", "ModelNodalData", "NodalDataType", - "OffsetDirectionType", + "SolidModelOffsetDirectionType", "OffsetType", "OrientedSelectionSet", "OrientedSelectionSetElementalData", @@ -295,7 +295,7 @@ "SphericalSelectionRuleElementalData", "SphericalSelectionRuleNodalData", "Stackup", - "StatusType", + "Status", "StressStateType", "SubLaminate", "SubShape", diff --git a/src/ansys/acp/core/_tree_objects/_grpc_helpers/mapping.py b/src/ansys/acp/core/_tree_objects/_grpc_helpers/mapping.py index 57c571e154..35e8a8fafc 100644 --- a/src/ansys/acp/core/_tree_objects/_grpc_helpers/mapping.py +++ b/src/ansys/acp/core/_tree_objects/_grpc_helpers/mapping.py @@ -36,7 +36,7 @@ from ..._utils.resource_paths import join as _rp_join from .._object_cache import ObjectCacheMixin, constructor_with_cache from ..base import CreatableTreeObject, ServerWrapper, TreeObject, TreeObjectBase -from ..enums import StatusType +from ..enums import Status from .exceptions import wrap_grpc_errors from .property_helper import _exposed_grpc_property, _wrap_doc from .protocols import EditableAndReadableResourceStub, ObjectInfo, ReadableResourceStub @@ -260,7 +260,7 @@ def get_read_only_collection_property( """Define a read-only mapping of child tree objects.""" def collection_property(self: ParentT) -> Mapping[ValueT]: - if requires_uptodate and hasattr(self, "status") and not self.status == StatusType.UPTODATE: + if requires_uptodate and hasattr(self, "status") and not self.status == Status.UPTODATE: raise RuntimeError( f"The object {self.name} must be up-to-date to access {object_class.__name__}." ) diff --git a/src/ansys/acp/core/_tree_objects/boolean_selection_rule.py b/src/ansys/acp/core/_tree_objects/boolean_selection_rule.py index d1f90f3edb..b1f30e01ff 100644 --- a/src/ansys/acp/core/_tree_objects/boolean_selection_rule.py +++ b/src/ansys/acp/core/_tree_objects/boolean_selection_rule.py @@ -81,7 +81,7 @@ class BooleanSelectionRule(CreatableTreeObject, IdTreeObject): Name of the Boolean Selection Rule. selection_rules : - include_rule_type : + include_rule : Include or exclude area in rule. Setting this to ``False`` inverts the selection. """ @@ -98,11 +98,11 @@ def __init__( *, name: str = "BooleanSelectionrule", selection_rules: Iterable[LinkedSelectionRule] = (), - include_rule_type: bool = True, + include_rule: bool = True, ): super().__init__(name=name) self.selection_rules = selection_rules - self.include_rule_type = include_rule_type + self.include_rule = include_rule def _create_stub(self) -> boolean_selection_rule_pb2_grpc.ObjectServiceStub: return boolean_selection_rule_pb2_grpc.ObjectServiceStub(self._channel) @@ -118,9 +118,7 @@ def _create_stub(self) -> boolean_selection_rule_pb2_grpc.ObjectServiceStub: module_name=__module__, ) - include_rule_type: ReadWriteProperty[bool, bool] = grpc_data_property( - "properties.include_rule_type" - ) + include_rule: ReadWriteProperty[bool, bool] = grpc_data_property("properties.include_rule_type") elemental_data = elemental_data_property(BooleanSelectionRuleElementalData) nodal_data = nodal_data_property(BooleanSelectionRuleNodalData) diff --git a/src/ansys/acp/core/_tree_objects/cylindrical_selection_rule.py b/src/ansys/acp/core/_tree_objects/cylindrical_selection_rule.py index 68fbfdfc49..d0d23ad900 100644 --- a/src/ansys/acp/core/_tree_objects/cylindrical_selection_rule.py +++ b/src/ansys/acp/core/_tree_objects/cylindrical_selection_rule.py @@ -91,9 +91,9 @@ class CylindricalSelectionRule(CreatableTreeObject, IdTreeObject): Direction of the Cylindrical Selection Rule. radius : Radius of the cylinder. - relative_rule_type : + relative_rule : If True, parameters are evaluated relative to size of the object. - include_rule_type : + include_rule : Include or exclude area in rule. Setting this to ``False`` inverts the selection. """ @@ -114,8 +114,8 @@ def __init__( origin: tuple[float, ...] = (0.0, 0.0, 0.0), direction: tuple[float, ...] = (0.0, 0.0, 1.0), radius: float = 0.0, - relative_rule_type: bool = False, - include_rule_type: bool = True, + relative_rule: bool = False, + include_rule: bool = True, ): super().__init__(name=name) self.use_global_coordinate_system = use_global_coordinate_system @@ -123,8 +123,8 @@ def __init__( self.origin = origin self.direction = direction self.radius = radius - self.relative_rule_type = relative_rule_type - self.include_rule_type = include_rule_type + self.relative_rule = relative_rule + self.include_rule = include_rule def _create_stub(self) -> cylindrical_selection_rule_pb2_grpc.ObjectServiceStub: return cylindrical_selection_rule_pb2_grpc.ObjectServiceStub(self._channel) @@ -142,12 +142,10 @@ def _create_stub(self) -> cylindrical_selection_rule_pb2_grpc.ObjectServiceStub: "properties.direction", from_protobuf=to_tuple_from_1D_array, to_protobuf=to_1D_double_array ) radius: ReadWriteProperty[float, float] = grpc_data_property("properties.radius") - relative_rule_type: ReadWriteProperty[bool, bool] = grpc_data_property( + relative_rule: ReadWriteProperty[bool, bool] = grpc_data_property( "properties.relative_rule_type" ) - include_rule_type: ReadWriteProperty[bool, bool] = grpc_data_property( - "properties.include_rule_type" - ) + include_rule: ReadWriteProperty[bool, bool] = grpc_data_property("properties.include_rule_type") elemental_data = elemental_data_property(CylindricalSelectionRuleElementalData) nodal_data = nodal_data_property(CylindricalSelectionRuleNodalData) diff --git a/src/ansys/acp/core/_tree_objects/enums.py b/src/ansys/acp/core/_tree_objects/enums.py index 76456e3b80..d4715cdd91 100644 --- a/src/ansys/acp/core/_tree_objects/enums.py +++ b/src/ansys/acp/core/_tree_objects/enums.py @@ -51,12 +51,12 @@ "ArrowType", "BooleanOperationType", "CutOffGeometryOrientationType", - "CutoffMaterialType", + "CutoffMaterialHandling", "CutoffRuleType", "DimensionType", - "DrapingMaterialType", + "DrapingMaterialModel", "DrapingType", - "DropoffMaterialType", + "DropoffMaterialHandling", "DropOffType", "EdgeSetType", "ElementalDataType", @@ -65,7 +65,7 @@ "BaseElementMaterialHandling", "StressStateType", "ExtrusionGuideType", - "ExtrusionMethodType", + "ExtrusionMethod", "ExtrusionType", "GeometricalRuleType", "ImportedPlyDrapingType", @@ -75,7 +75,7 @@ "LookUpTable3DInterpolationAlgorithm", "LookUpTableColumnValueType", "NodalDataType", - "OffsetDirectionType", + "SolidModelOffsetDirectionType", "OffsetType", "PlyCutoffType", "PlyGeometryExportFormat", @@ -87,7 +87,7 @@ "SnapToGeometryOrientationType", "SolidModelExportFormat", "SolidModelSkinExportFormat", - "StatusType", + "Status", "SymmetryType", "ThicknessFieldType", "ThicknessType", @@ -95,8 +95,8 @@ "VirtualGeometryDimension", ] -(StatusType, status_type_to_pb, status_type_from_pb) = wrap_to_string_enum( - "StatusType", +(Status, status_type_to_pb, status_type_from_pb) = wrap_to_string_enum( + "Status", enum_types_pb2.StatusType, module=__name__, value_converter=lambda val: val, @@ -114,22 +114,22 @@ ) ( - CutoffMaterialType, + CutoffMaterialHandling, cut_off_material_type_to_pb, cut_off_material_type_from_pb, ) = wrap_to_string_enum( - "CutoffMaterialType", + "CutoffMaterialHandling", cut_off_material_pb2.MaterialHandlingType, module=__name__, doc="Options for how cut-off material is selected.", ) ( - DropoffMaterialType, + DropoffMaterialHandling, drop_off_material_type_to_pb, drop_off_material_type_from_pb, ) = wrap_to_string_enum( - "DropoffMaterialType", + "DropoffMaterialHandling", drop_off_material_pb2.MaterialHandlingType, module=__name__, doc="Options for how drop-off material is selected.", @@ -162,11 +162,11 @@ ) ( - DrapingMaterialType, + DrapingMaterialModel, draping_material_type_to_pb, draping_material_type_from_pb, ) = wrap_to_string_enum( - "DrapingMaterialType", + "DrapingMaterialModel", ply_material_pb2.DrapingMaterialType, module=__name__, doc="Options for the material type used in the draping algorithm.", @@ -472,13 +472,11 @@ doc="Determines how the intersection is computed for wireframe section cuts.", ) -(ExtrusionMethodType, extrusion_method_type_to_pb, extrusion_method_type_from_pb) = ( - wrap_to_string_enum( - "ExtrusionMethodType", - solid_model_pb2.ExtrusionMethodType, - module=__name__, - doc="Extrusion method used in a solid model.", - ) +(ExtrusionMethod, extrusion_method_type_to_pb, extrusion_method_type_from_pb) = wrap_to_string_enum( + "ExtrusionMethod", + solid_model_pb2.ExtrusionMethodType, + module=__name__, + doc="Extrusion method used in a solid model.", ) (ExtrusionGuideType, extrusion_guide_type_to_pb, extrusion_guide_type_from_pb) = ( @@ -490,9 +488,9 @@ ) ) -(OffsetDirectionType, offset_direction_type_to_pb, offset_direction_type_from_pb) = ( +(SolidModelOffsetDirectionType, offset_direction_type_to_pb, offset_direction_type_from_pb) = ( wrap_to_string_enum( - "OffsetDirectionType", + "SolidModelOffsetDirectionType", solid_model_pb2.OffsetDirectionType, module=__name__, doc=( diff --git a/src/ansys/acp/core/_tree_objects/fabric.py b/src/ansys/acp/core/_tree_objects/fabric.py index 99e04b8791..4ff1fc2f0c 100644 --- a/src/ansys/acp/core/_tree_objects/fabric.py +++ b/src/ansys/acp/core/_tree_objects/fabric.py @@ -35,9 +35,9 @@ ) from .base import CreatableTreeObject, IdTreeObject from .enums import ( - CutoffMaterialType, - DrapingMaterialType, - DropoffMaterialType, + CutoffMaterialHandling, + DrapingMaterialModel, + DropoffMaterialHandling, cut_off_material_type_from_pb, cut_off_material_type_to_pb, draping_material_type_from_pb, @@ -100,11 +100,11 @@ def __init__( thickness: float = 0.0, area_price: float = 0.0, ignore_for_postprocessing: bool = False, - drop_off_material_handling: DropoffMaterialType = "global", + drop_off_material_handling: DropoffMaterialHandling = "global", drop_off_material: Material | None = None, - cut_off_material_handling: CutoffMaterialType = "computed", + cut_off_material_handling: CutoffMaterialHandling = "computed", cut_off_material: Material | None = None, - draping_material_model: DrapingMaterialType = "woven", + draping_material_model: DrapingMaterialModel = "woven", draping_ud_coefficient: float = 0.0, ): super().__init__(name=name) @@ -113,11 +113,11 @@ def __init__( self.thickness = thickness self.area_price = area_price self.ignore_for_postprocessing = ignore_for_postprocessing - self.drop_off_material_handling = DropoffMaterialType(drop_off_material_handling) + self.drop_off_material_handling = DropoffMaterialHandling(drop_off_material_handling) self.drop_off_material = drop_off_material - self.cut_off_material_handling = CutoffMaterialType(cut_off_material_handling) + self.cut_off_material_handling = CutoffMaterialHandling(cut_off_material_handling) self.cut_off_material = cut_off_material - self.draping_material_model = DrapingMaterialType(draping_material_model) + self.draping_material_model = DrapingMaterialModel(draping_material_model) self.draping_ud_coefficient = draping_ud_coefficient def _create_stub(self) -> fabric_pb2_grpc.ObjectServiceStub: diff --git a/src/ansys/acp/core/_tree_objects/geometrical_selection_rule.py b/src/ansys/acp/core/_tree_objects/geometrical_selection_rule.py index b73720484f..7710d81cae 100644 --- a/src/ansys/acp/core/_tree_objects/geometrical_selection_rule.py +++ b/src/ansys/acp/core/_tree_objects/geometrical_selection_rule.py @@ -93,7 +93,7 @@ class GeometricalSelectionRule(CreatableTreeObject, IdTreeObject): Virtual geometry to use for the rule. element_sets : Element sets to use for the rule. - include_rule_type : + include_rule : Include or exclude area in rule. Setting this to ``False`` inverts the selection. use_default_tolerances : @@ -120,7 +120,7 @@ def __init__( geometrical_rule_type: GeometricalRuleType = GeometricalRuleType.GEOMETRY, geometry: VirtualGeometry | None = None, element_sets: Iterable[ElementSet] = (), - include_rule_type: bool = True, + include_rule: bool = True, use_default_tolerances: bool = True, in_plane_capture_tolerance: float = 0.0, negative_capture_tolerance: float = 0.0, @@ -130,7 +130,7 @@ def __init__( self.geometrical_rule_type = geometrical_rule_type self.geometry = geometry self.element_sets = element_sets - self.include_rule_type = include_rule_type + self.include_rule = include_rule self.use_default_tolerances = use_default_tolerances self.in_plane_capture_tolerance = in_plane_capture_tolerance self.negative_capture_tolerance = negative_capture_tolerance @@ -148,9 +148,7 @@ def _create_stub(self) -> geometrical_selection_rule_pb2_grpc.ObjectServiceStub: ) geometry = grpc_link_property("properties.geometry", allowed_types=VirtualGeometry) element_sets = define_linked_object_list("properties.element_sets", object_class=ElementSet) - include_rule_type: ReadWriteProperty[bool, bool] = grpc_data_property( - "properties.include_rule_type" - ) + include_rule: ReadWriteProperty[bool, bool] = grpc_data_property("properties.include_rule_type") use_default_tolerances: ReadWriteProperty[bool, bool] = grpc_data_property( "properties.use_default_tolerances" ) diff --git a/src/ansys/acp/core/_tree_objects/imported_modeling_ply.py b/src/ansys/acp/core/_tree_objects/imported_modeling_ply.py index 03a06e93ec..8614325c10 100644 --- a/src/ansys/acp/core/_tree_objects/imported_modeling_ply.py +++ b/src/ansys/acp/core/_tree_objects/imported_modeling_ply.py @@ -105,7 +105,7 @@ class ImportedModelingPly(CreatableTreeObject, IdTreeObject): The material (only fabric is supported) of the ply. ply_angle : Design angle between the reference direction and the ply fiber direction. - draping : + draping_type : Chooses between different draping formulations. ``NO_DRAPING`` by default. draping_angle_1_field : Correction angle between the fiber and draped fiber directions, in degree. @@ -148,7 +148,7 @@ def __init__( rotation_angle: float = 0.0, ply_material: Fabric | None = None, ply_angle: float = 0.0, - draping: ImportedPlyDrapingType = ImportedPlyDrapingType.NO_DRAPING, + draping_type: ImportedPlyDrapingType = ImportedPlyDrapingType.NO_DRAPING, draping_angle_1_field: LookUpTable1DColumn | LookUpTable3DColumn | None = None, draping_angle_2_field: LookUpTable1DColumn | LookUpTable3DColumn | None = None, thickness_type: ImportedPlyThicknessType = ImportedPlyThicknessType.NOMINAL, @@ -169,7 +169,7 @@ def __init__( self.ply_material = ply_material self.ply_angle = ply_angle - self.draping = ImportedPlyDrapingType(draping) + self.draping_type = ImportedPlyDrapingType(draping_type) self.draping_angle_1_field = draping_angle_1_field self.draping_angle_2_field = draping_angle_2_field @@ -210,7 +210,7 @@ def _create_stub(self) -> imported_modeling_ply_pb2_grpc.ObjectServiceStub: ply_material = grpc_link_property("properties.ply_material", allowed_types=(Fabric,)) ply_angle: ReadWriteProperty[float, float] = grpc_data_property("properties.ply_angle") - draping = grpc_data_property( + draping_type = grpc_data_property( "properties.draping", from_protobuf=imported_ply_draping_type_from_pb, to_protobuf=imported_ply_draping_type_to_pb, diff --git a/src/ansys/acp/core/_tree_objects/modeling_ply.py b/src/ansys/acp/core/_tree_objects/modeling_ply.py index 0dd1001bab..abc7eaaed2 100644 --- a/src/ansys/acp/core/_tree_objects/modeling_ply.py +++ b/src/ansys/acp/core/_tree_objects/modeling_ply.py @@ -255,7 +255,7 @@ class ModelingPly(CreatableTreeObject, IdTreeObject): Defines the global ply order. selection_rules : Selection Rules which may limit the extent of the ply. - draping : + draping_type : Chooses between different draping formulations. draping_seed_point : Starting point of the draping algorithm. @@ -319,7 +319,7 @@ def __init__( # if global_ply_nr == 0 global_ply_nr: int = 0, selection_rules: Iterable[LinkedSelectionRule] = (), - draping: DrapingType = DrapingType.NO_DRAPING, + draping_type: DrapingType = DrapingType.NO_DRAPING, draping_seed_point: tuple[float, float, float] = (0.0, 0.0, 0.0), auto_draping_direction: bool = True, draping_direction: tuple[float, float, float] = (1.0, 0.0, 0.0), @@ -343,7 +343,7 @@ def __init__( self.active = active self.global_ply_nr = global_ply_nr self.selection_rules = selection_rules - self.draping = draping + self.draping_type = draping_type self.draping_seed_point = draping_seed_point self.auto_draping_direction = auto_draping_direction self.draping_direction = draping_direction @@ -378,7 +378,7 @@ def _create_stub(self) -> modeling_ply_pb2_grpc.ObjectServiceStub: active: ReadWriteProperty[bool, bool] = grpc_data_property("properties.active") global_ply_nr: ReadWriteProperty[int, int] = grpc_data_property("properties.global_ply_nr") - draping = grpc_data_property( + draping_type = grpc_data_property( "properties.draping", from_protobuf=draping_type_from_pb, to_protobuf=draping_type_to_pb ) draping_seed_point = grpc_data_property( diff --git a/src/ansys/acp/core/_tree_objects/oriented_selection_set.py b/src/ansys/acp/core/_tree_objects/oriented_selection_set.py index bd0735146e..28994688da 100644 --- a/src/ansys/acp/core/_tree_objects/oriented_selection_set.py +++ b/src/ansys/acp/core/_tree_objects/oriented_selection_set.py @@ -52,7 +52,7 @@ from .cylindrical_selection_rule import CylindricalSelectionRule from .element_set import ElementSet from .enums import ( - DrapingMaterialType, + DrapingMaterialModel, RosetteSelectionMethod, draping_material_type_from_pb, draping_material_type_to_pb, @@ -149,7 +149,7 @@ class OrientedSelectionSet(CreatableTreeObject, IdTreeObject): draping_ud_coefficient : Value between ``0`` and ``1`` which determines the amount of deformation in the transverse direction if the draping material model is set to - :attr:`DrapingMaterialType.UD`. + :attr:`DrapingMaterialModel.UD`. rotation_angle : Angle in degrees by which the initial reference directions are rotated around the orientations. reference_direction_field : @@ -180,7 +180,7 @@ def __init__( draping_direction: tuple[float, float, float] = (0.0, 0.0, 1.0), use_default_draping_mesh_size: bool = True, draping_mesh_size: float = 0.0, - draping_material_model: DrapingMaterialType = DrapingMaterialType.WOVEN, + draping_material_model: DrapingMaterialModel = DrapingMaterialModel.WOVEN, draping_ud_coefficient: float = 0.0, rotation_angle: float = 0.0, reference_direction_field: LookUpTable1DColumn | LookUpTable3DColumn | None = None, @@ -198,7 +198,7 @@ def __init__( self.draping_direction = draping_direction self.use_default_draping_mesh_size = use_default_draping_mesh_size self.draping_mesh_size = draping_mesh_size - self.draping_material_model = DrapingMaterialType(draping_material_model) + self.draping_material_model = DrapingMaterialModel(draping_material_model) self.draping_ud_coefficient = draping_ud_coefficient self.rotation_angle = rotation_angle self.reference_direction_field = reference_direction_field diff --git a/src/ansys/acp/core/_tree_objects/parallel_selection_rule.py b/src/ansys/acp/core/_tree_objects/parallel_selection_rule.py index c9bcfac5e4..656031bc6f 100644 --- a/src/ansys/acp/core/_tree_objects/parallel_selection_rule.py +++ b/src/ansys/acp/core/_tree_objects/parallel_selection_rule.py @@ -93,9 +93,9 @@ class ParallelSelectionRule(CreatableTreeObject, IdTreeObject): Negative distance of the Parallel Selection Rule. upper_limit : Positive distance of the Parallel Selection Rule. - relative_rule_type : + relative_rule : If True, parameters are evaluated relative to size of the object. - include_rule_type : + include_rule : Include or exclude area in rule. Setting this to ``False`` inverts the selection. """ @@ -117,8 +117,8 @@ def __init__( direction: tuple[float, ...] = (1.0, 0.0, 0.0), lower_limit: float = 0.0, upper_limit: float = 0.0, - relative_rule_type: bool = False, - include_rule_type: bool = True, + relative_rule: bool = False, + include_rule: bool = True, ): super().__init__(name=name) self.use_global_coordinate_system = use_global_coordinate_system @@ -127,8 +127,8 @@ def __init__( self.direction = direction self.lower_limit = lower_limit self.upper_limit = upper_limit - self.relative_rule_type = relative_rule_type - self.include_rule_type = include_rule_type + self.relative_rule = relative_rule + self.include_rule = include_rule def _create_stub(self) -> parallel_selection_rule_pb2_grpc.ObjectServiceStub: return parallel_selection_rule_pb2_grpc.ObjectServiceStub(self._channel) @@ -147,12 +147,10 @@ def _create_stub(self) -> parallel_selection_rule_pb2_grpc.ObjectServiceStub: ) lower_limit: ReadWriteProperty[float, float] = grpc_data_property("properties.lower_limit") upper_limit: ReadWriteProperty[float, float] = grpc_data_property("properties.upper_limit") - relative_rule_type: ReadWriteProperty[bool, bool] = grpc_data_property( + relative_rule: ReadWriteProperty[bool, bool] = grpc_data_property( "properties.relative_rule_type" ) - include_rule_type: ReadWriteProperty[bool, bool] = grpc_data_property( - "properties.include_rule_type" - ) + include_rule: ReadWriteProperty[bool, bool] = grpc_data_property("properties.include_rule_type") elemental_data = elemental_data_property(ParallelSelectionRuleElementalData) nodal_data = nodal_data_property(ParallelSelectionRuleNodalData) diff --git a/src/ansys/acp/core/_tree_objects/solid_model.py b/src/ansys/acp/core/_tree_objects/solid_model.py index 96ccb685a2..72fc4eb8c6 100644 --- a/src/ansys/acp/core/_tree_objects/solid_model.py +++ b/src/ansys/acp/core/_tree_objects/solid_model.py @@ -70,8 +70,8 @@ from .element_set import ElementSet from .enums import ( DropOffType, - ExtrusionMethodType, - OffsetDirectionType, + ExtrusionMethod, + SolidModelOffsetDirectionType, drop_off_type_from_pb, drop_off_type_to_pb, extrusion_method_type_from_pb, @@ -371,7 +371,7 @@ class SolidModel(SolidModelExportMixin, CreatableTreeObject, IdTreeObject): ply_group_pointers : Explicitly defines modeling plies where a new element is introduced. Only used if the ``extrusion_method`` is ``USER_DEFINED``. - offset_direction : + offset_direction_type : Determines how the extrusion direction is defined. With ``SHELL_NORMAL``, the normal direction of the shell is used during the entire extrusion. With ``SURFACE_NORMAL``, the offset direction is re-evaluated based @@ -418,10 +418,10 @@ def __init__( name: str = "SolidModel", active: bool = True, element_sets: Iterable[ElementSet | OrientedSelectionSet] = (), - extrusion_method: ExtrusionMethodType = ExtrusionMethodType.ANALYSIS_PLY_WISE, + extrusion_method: ExtrusionMethod = ExtrusionMethod.ANALYSIS_PLY_WISE, max_element_thickness: float = 1.0, ply_group_pointers: Iterable[ModelingPly] = (), - offset_direction: OffsetDirectionType = OffsetDirectionType.SHELL_NORMAL, + offset_direction_type: SolidModelOffsetDirectionType = SolidModelOffsetDirectionType.SHELL_NORMAL, skip_elements_without_plies: bool = False, drop_off_material: Material | None = None, cut_off_material: Material | None = None, @@ -439,7 +439,7 @@ def __init__( self.extrusion_method = extrusion_method self.max_element_thickness = max_element_thickness self.ply_group_pointers = ply_group_pointers - self.offset_direction = offset_direction + self.offset_direction_type = offset_direction_type self.skip_elements_without_plies = skip_elements_without_plies self.drop_off_material = drop_off_material self.cut_off_material = cut_off_material @@ -468,7 +468,7 @@ def _create_stub(self) -> solid_model_pb2_grpc.ObjectServiceStub: "properties.max_element_thickness" ) ply_group_pointers = define_linked_object_list("properties.ply_group_pointers", ModelingPly) - offset_direction = grpc_data_property( + offset_direction_type = grpc_data_property( "properties.offset_direction", from_protobuf=offset_direction_type_from_pb, to_protobuf=offset_direction_type_to_pb, diff --git a/src/ansys/acp/core/_tree_objects/spherical_selection_rule.py b/src/ansys/acp/core/_tree_objects/spherical_selection_rule.py index 7fbb45702b..3a78b22e11 100644 --- a/src/ansys/acp/core/_tree_objects/spherical_selection_rule.py +++ b/src/ansys/acp/core/_tree_objects/spherical_selection_rule.py @@ -89,9 +89,9 @@ class SphericalSelectionRule(CreatableTreeObject, IdTreeObject): Origin of the sphere. radius : Radius of the sphere. - relative_rule_type : + relative_rule : If True, parameters are evaluated relative to size of the object. - include_rule_type : + include_rule : Include or exclude area in rule. Setting this to ``False`` inverts the selection. """ @@ -111,16 +111,16 @@ def __init__( rosette: Rosette | None = None, origin: tuple[float, ...] = (0.0, 0.0, 0.0), radius: float = 0.0, - relative_rule_type: bool = False, - include_rule_type: bool = True, + relative_rule: bool = False, + include_rule: bool = True, ): super().__init__(name=name) self.use_global_coordinate_system = use_global_coordinate_system self.rosette = rosette self.origin = origin self.radius = radius - self.relative_rule_type = relative_rule_type - self.include_rule_type = include_rule_type + self.relative_rule = relative_rule + self.include_rule = include_rule def _create_stub(self) -> spherical_selection_rule_pb2_grpc.ObjectServiceStub: return spherical_selection_rule_pb2_grpc.ObjectServiceStub(self._channel) @@ -138,12 +138,10 @@ def _create_stub(self) -> spherical_selection_rule_pb2_grpc.ObjectServiceStub: "properties.direction", from_protobuf=to_tuple_from_1D_array, to_protobuf=to_1D_double_array ) radius: ReadWriteProperty[float, float] = grpc_data_property("properties.radius") - relative_rule_type: ReadWriteProperty[bool, bool] = grpc_data_property( + relative_rule: ReadWriteProperty[bool, bool] = grpc_data_property( "properties.relative_rule_type" ) - include_rule_type: ReadWriteProperty[bool, bool] = grpc_data_property( - "properties.include_rule_type" - ) + include_rule: ReadWriteProperty[bool, bool] = grpc_data_property("properties.include_rule_type") elemental_data = elemental_data_property(SphericalSelectionRuleElementalData) nodal_data = nodal_data_property(SphericalSelectionRuleNodalData) diff --git a/src/ansys/acp/core/_tree_objects/stackup.py b/src/ansys/acp/core/_tree_objects/stackup.py index 8f69713553..aeb33a82f9 100644 --- a/src/ansys/acp/core/_tree_objects/stackup.py +++ b/src/ansys/acp/core/_tree_objects/stackup.py @@ -44,9 +44,9 @@ ) from .base import CreatableTreeObject, IdTreeObject from .enums import ( - CutoffMaterialType, - DrapingMaterialType, - DropoffMaterialType, + CutoffMaterialHandling, + DrapingMaterialModel, + DropoffMaterialHandling, SymmetryType, cut_off_material_type_from_pb, cut_off_material_type_to_pb, @@ -197,11 +197,11 @@ def __init__( topdown: bool = True, fabrics: Sequence[FabricWithAngle] = tuple(), area_price: float = 0.0, - drop_off_material_handling: DropoffMaterialType = "global", + drop_off_material_handling: DropoffMaterialHandling = "global", drop_off_material: Material | None = None, cut_off_material: Material | None = None, - cut_off_material_handling: CutoffMaterialType = "computed", - draping_material_model: DrapingMaterialType = "woven", + cut_off_material_handling: CutoffMaterialHandling = "computed", + draping_material_model: DrapingMaterialModel = "woven", draping_ud_coefficient: float = 0.0, ): super().__init__(name=name) @@ -210,11 +210,11 @@ def __init__( self.topdown = topdown self.area_price = area_price self.fabrics = fabrics - self.drop_off_material_handling = DropoffMaterialType(drop_off_material_handling) + self.drop_off_material_handling = DropoffMaterialHandling(drop_off_material_handling) self.drop_off_material = drop_off_material - self.cut_off_material_handling = CutoffMaterialType(cut_off_material_handling) + self.cut_off_material_handling = CutoffMaterialHandling(cut_off_material_handling) self.cut_off_material = cut_off_material - self.draping_material_model = DrapingMaterialType(draping_material_model) + self.draping_material_model = DrapingMaterialModel(draping_material_model) self.draping_ud_coefficient = draping_ud_coefficient def _create_stub(self) -> stackup_pb2_grpc.ObjectServiceStub: diff --git a/src/ansys/acp/core/_tree_objects/tube_selection_rule.py b/src/ansys/acp/core/_tree_objects/tube_selection_rule.py index 6c3f29c63b..17f90ac91d 100644 --- a/src/ansys/acp/core/_tree_objects/tube_selection_rule.py +++ b/src/ansys/acp/core/_tree_objects/tube_selection_rule.py @@ -86,7 +86,7 @@ class TubeSelectionRule(CreatableTreeObject, IdTreeObject): Outer radius of the tube. inner_radius : Inner radius of the tube. - include_rule_type : + include_rule : Include or exclude area in rule. Setting this to ``False`` inverts the selection. extend_endings : @@ -118,7 +118,7 @@ def __init__( edge_set: EdgeSet | None = None, outer_radius: float = 1.0, inner_radius: float = 0.0, - include_rule_type: bool = True, + include_rule: bool = True, extend_endings: bool = False, symmetrical_extension: bool = True, head: tuple[float, float, float] = (0.0, 0.0, 0.0), @@ -129,7 +129,7 @@ def __init__( self.edge_set = edge_set self.outer_radius = outer_radius self.inner_radius = inner_radius - self.include_rule_type = include_rule_type + self.include_rule = include_rule self.extend_endings = extend_endings self.symmetrical_extension = symmetrical_extension self.head = head @@ -144,9 +144,7 @@ def _create_stub(self) -> tube_selection_rule_pb2_grpc.ObjectServiceStub: edge_set = grpc_link_property("properties.edge_set", allowed_types=EdgeSet) outer_radius: ReadWriteProperty[float, float] = grpc_data_property("properties.outer_radius") inner_radius: ReadWriteProperty[float, float] = grpc_data_property("properties.inner_radius") - include_rule_type: ReadWriteProperty[bool, bool] = grpc_data_property( - "properties.include_rule_type" - ) + include_rule: ReadWriteProperty[bool, bool] = grpc_data_property("properties.include_rule_type") extend_endings: ReadWriteProperty[bool, bool] = grpc_data_property("properties.extend_endings") symmetrical_extension: ReadWriteProperty[bool, bool] = grpc_data_property( "properties.symmetrical_extension" diff --git a/src/ansys/acp/core/_tree_objects/variable_offset_selection_rule.py b/src/ansys/acp/core/_tree_objects/variable_offset_selection_rule.py index b70c8934ac..3830cb8c9f 100644 --- a/src/ansys/acp/core/_tree_objects/variable_offset_selection_rule.py +++ b/src/ansys/acp/core/_tree_objects/variable_offset_selection_rule.py @@ -91,7 +91,7 @@ class VariableOffsetSelectionRule(CreatableTreeObject, IdTreeObject): Defines the in-plane offset. Cuts elements which are closer to the edge than this value. angles : Defines the angle between the reference surface and the cutting plane. - include_rule_type : + include_rule : Include or exclude area in rule. Setting this to ``False`` inverts the selection. use_offset_correction : @@ -125,7 +125,7 @@ def __init__( edge_set: EdgeSet | None = None, offsets: LookUpTable1DColumn | None = None, angles: LookUpTable1DColumn | None = None, - include_rule_type: bool = True, + include_rule: bool = True, use_offset_correction: bool = False, element_set: ElementSet | None = None, inherit_from_lookup_table: bool = True, @@ -137,7 +137,7 @@ def __init__( self.edge_set = edge_set self.offsets = offsets self.angles = angles - self.include_rule_type = include_rule_type + self.include_rule = include_rule self.use_offset_correction = use_offset_correction self.element_set = element_set self.inherit_from_lookup_table = inherit_from_lookup_table @@ -153,9 +153,7 @@ def _create_stub(self) -> variable_offset_selection_rule_pb2_grpc.ObjectServiceS edge_set = grpc_link_property("properties.edge_set", allowed_types=EdgeSet) offsets = grpc_link_property("properties.offsets", allowed_types=LookUpTable1DColumn) angles = grpc_link_property("properties.angles", allowed_types=LookUpTable1DColumn) - include_rule_type: ReadWriteProperty[bool, bool] = grpc_data_property( - "properties.include_rule_type" - ) + include_rule: ReadWriteProperty[bool, bool] = grpc_data_property("properties.include_rule_type") use_offset_correction: ReadWriteProperty[bool, bool] = grpc_data_property( "properties.use_offset_correction" ) diff --git a/tests/unittests/test_boolean_selection_rule.py b/tests/unittests/test_boolean_selection_rule.py index b447e3b253..db49b6df3f 100644 --- a/tests/unittests/test_boolean_selection_rule.py +++ b/tests/unittests/test_boolean_selection_rule.py @@ -52,7 +52,7 @@ def default_properties(): return { "status": "NOTUPTODATE", "selection_rules": [], - "include_rule_type": True, + "include_rule": True, } CREATE_METHOD_NAME = "create_boolean_selection_rule" @@ -112,7 +112,7 @@ def object_properties(parent_object): ), ], ), - ("include_rule_type", False), + ("include_rule", False), ], read_only=[ ("id", "some_id"), diff --git a/tests/unittests/test_cylindrical_selection_rule.py b/tests/unittests/test_cylindrical_selection_rule.py index 7674d32c0a..c3c55a13cc 100644 --- a/tests/unittests/test_cylindrical_selection_rule.py +++ b/tests/unittests/test_cylindrical_selection_rule.py @@ -51,8 +51,8 @@ def default_properties(): "origin": (0.0, 0.0, 0.0), "direction": (0.0, 0.0, 1.0), "radius": 0.0, - "relative_rule_type": False, - "include_rule_type": True, + "relative_rule": False, + "include_rule": True, } CREATE_METHOD_NAME = "create_cylindrical_selection_rule" @@ -70,8 +70,8 @@ def object_properties(parent_object): ("origin", (1.0, 2.0, 3.0)), ("direction", (4.0, 5.0, 6.0)), ("radius", 7.0), - ("relative_rule_type", True), - ("include_rule_type", False), + ("relative_rule", True), + ("include_rule", False), ], read_only=[ ("id", "some_id"), diff --git a/tests/unittests/test_fabric.py b/tests/unittests/test_fabric.py index 1e53dd7bb7..70b251c591 100644 --- a/tests/unittests/test_fabric.py +++ b/tests/unittests/test_fabric.py @@ -23,7 +23,7 @@ from packaging.version import parse as parse_version import pytest -from ansys.acp.core import CutoffMaterialType, DrapingMaterialType, DropoffMaterialType +from ansys.acp.core import CutoffMaterialHandling, DrapingMaterialModel, DropoffMaterialHandling from .common.tree_object_tester import NoLockedMixin, ObjectPropertiesToTest, TreeObjectTester @@ -51,9 +51,9 @@ def default_properties(acp_instance): "thickness": 0.0, "area_price": 0.0, "ignore_for_postprocessing": False, - "drop_off_material_handling": DropoffMaterialType.GLOBAL, - "cut_off_material_handling": CutoffMaterialType.COMPUTED, - "draping_material_model": DrapingMaterialType.WOVEN, + "drop_off_material_handling": DropoffMaterialHandling.GLOBAL, + "cut_off_material_handling": CutoffMaterialHandling.COMPUTED, + "draping_material_model": DrapingMaterialModel.WOVEN, "draping_ud_coefficient": 0.0, "material": None, } @@ -63,11 +63,11 @@ def default_properties(acp_instance): "thickness": 0.0, "area_price": 0.0, "ignore_for_postprocessing": False, - "drop_off_material_handling": DropoffMaterialType.GLOBAL, + "drop_off_material_handling": DropoffMaterialHandling.GLOBAL, "drop_off_material": None, - "cut_off_material_handling": CutoffMaterialType.COMPUTED, + "cut_off_material_handling": CutoffMaterialHandling.COMPUTED, "cut_off_material": None, - "draping_material_model": DrapingMaterialType.WOVEN, + "draping_material_model": DrapingMaterialModel.WOVEN, "draping_ud_coefficient": 0.0, "material": None, } @@ -88,9 +88,9 @@ def object_properties(parent_object, acp_instance): ("thickness", 1e-6), ("area_price", 5.98), ("ignore_for_postprocessing", True), - ("drop_off_material_handling", DropoffMaterialType.GLOBAL), - ("cut_off_material_handling", CutoffMaterialType.COMPUTED), - ("draping_material_model", DrapingMaterialType.UD), + ("drop_off_material_handling", DropoffMaterialHandling.GLOBAL), + ("cut_off_material_handling", CutoffMaterialHandling.COMPUTED), + ("draping_material_model", DrapingMaterialModel.UD), ("draping_ud_coefficient", 0.55), ("material", material), ("material", None), @@ -110,11 +110,11 @@ def object_properties(parent_object, acp_instance): ("thickness", 1e-6), ("area_price", 5.98), ("ignore_for_postprocessing", True), - ("drop_off_material_handling", DropoffMaterialType.CUSTOM), + ("drop_off_material_handling", DropoffMaterialHandling.CUSTOM), ("drop_off_material", drop_off_material), - ("cut_off_material_handling", CutoffMaterialType.CUSTOM), + ("cut_off_material_handling", CutoffMaterialHandling.CUSTOM), ("cut_off_material", cut_off_material), - ("draping_material_model", DrapingMaterialType.UD), + ("draping_material_model", DrapingMaterialModel.UD), ("draping_ud_coefficient", 0.55), ("material", material), ("material", None), @@ -131,8 +131,8 @@ def object_properties(parent_object, acp_instance): @pytest.mark.parametrize("material_type", ["cut_off_material", "drop_off_material"]) def test_solid_model_materials(parent_object, tree_object, acp_instance, material_type): """Check that solid model materials are supported since 25.1.""" - tree_object.cut_off_material_handling = CutoffMaterialType.CUSTOM - tree_object.drop_off_material_handling = DropoffMaterialType.CUSTOM + tree_object.cut_off_material_handling = CutoffMaterialHandling.CUSTOM + tree_object.drop_off_material_handling = DropoffMaterialHandling.CUSTOM if parse_version(acp_instance.server_version) < parse_version("25.1"): with pytest.raises(RuntimeError) as exc: setattr(tree_object, material_type, parent_object.create_material(name="Material")) diff --git a/tests/unittests/test_geometrical_selection_rule.py b/tests/unittests/test_geometrical_selection_rule.py index 77ffbd85d0..3a924dc867 100644 --- a/tests/unittests/test_geometrical_selection_rule.py +++ b/tests/unittests/test_geometrical_selection_rule.py @@ -53,7 +53,7 @@ def default_properties(): "geometrical_rule_type": GeometricalRuleType.GEOMETRY, "geometry": None, "element_sets": [], - "include_rule_type": True, + "include_rule": True, "use_default_tolerances": True, "in_plane_capture_tolerance": 0.0, "negative_capture_tolerance": 0.0, @@ -74,7 +74,7 @@ def object_properties(parent_object): ("geometrical_rule_type", GeometricalRuleType.ELEMENT_SETS), ("geometry", geometry), ("element_sets", element_sets), - ("include_rule_type", False), + ("include_rule", False), ("use_default_tolerances", False), ("in_plane_capture_tolerance", 1.2), ("negative_capture_tolerance", 2.3), diff --git a/tests/unittests/test_imported_modeling_ply.py b/tests/unittests/test_imported_modeling_ply.py index ca19bdf7e5..1ec31cf894 100644 --- a/tests/unittests/test_imported_modeling_ply.py +++ b/tests/unittests/test_imported_modeling_ply.py @@ -84,7 +84,7 @@ def default_properties(): "rotation_angle": 0.0, "ply_material": None, "ply_angle": 0.0, - "draping": ImportedPlyDrapingType.NO_DRAPING, + "draping_type": ImportedPlyDrapingType.NO_DRAPING, "draping_angle_1_field": None, "draping_angle_2_field": None, "thickness_type": ImportedPlyThicknessType.NOMINAL, @@ -115,7 +115,7 @@ def object_properties(request, minimal_complete_model): ("rotation_angle", 67.2), ("ply_material", ply_material), ("ply_angle", 34.5), - ("draping", ImportedPlyDrapingType.TABULAR_VALUES), + ("draping_type", ImportedPlyDrapingType.TABULAR_VALUES), ("draping_angle_1_field", column_1), ("draping_angle_2_field", column_2), ("thickness_type", ImportedPlyThicknessType.FROM_TABLE), diff --git a/tests/unittests/test_modeling_ply.py b/tests/unittests/test_modeling_ply.py index a5cc3b6ffd..7697995646 100644 --- a/tests/unittests/test_modeling_ply.py +++ b/tests/unittests/test_modeling_ply.py @@ -76,7 +76,7 @@ def default_properties(): "ply_angle": 0.0, "active": True, "global_ply_nr": AnyThing(), - "draping": DrapingType.NO_DRAPING, + "draping_type": DrapingType.NO_DRAPING, "draping_seed_point": (0.0, 0.0, 0.0), "auto_draping_direction": True, "draping_direction": (1.0, 0.0, 0.0), diff --git a/tests/unittests/test_parallel_selection_rule.py b/tests/unittests/test_parallel_selection_rule.py index 37845a34dc..62bd32da35 100644 --- a/tests/unittests/test_parallel_selection_rule.py +++ b/tests/unittests/test_parallel_selection_rule.py @@ -56,8 +56,8 @@ def default_properties(): "direction": (1.0, 0.0, 0.0), "lower_limit": 0.0, "upper_limit": 0.0, - "relative_rule_type": False, - "include_rule_type": True, + "relative_rule": False, + "include_rule": True, } CREATE_METHOD_NAME = "create_parallel_selection_rule" @@ -76,8 +76,8 @@ def object_properties(parent_object): ("direction", (4.0, 5.0, 6.0)), ("lower_limit", 7.0), ("upper_limit", 8.0), - ("relative_rule_type", True), - ("include_rule_type", False), + ("relative_rule", True), + ("include_rule", False), ], read_only=[ ("id", "some_id"), diff --git a/tests/unittests/test_solid_model.py b/tests/unittests/test_solid_model.py index 9bdc5e22b2..b07060988e 100644 --- a/tests/unittests/test_solid_model.py +++ b/tests/unittests/test_solid_model.py @@ -90,10 +90,10 @@ def object_properties(parent_object): "element_sets", [model.create_element_set(), model.create_oriented_selection_set()], ), - ("extrusion_method", pyacp.ExtrusionMethodType.MONOLITHIC), + ("extrusion_method", pyacp.ExtrusionMethod.MONOLITHIC), ("max_element_thickness", 12.3), ("ply_group_pointers", [modeling_group.create_modeling_ply() for _ in range(3)]), - ("offset_direction", pyacp.OffsetDirectionType.SURFACE_NORMAL), + ("offset_direction_type", pyacp.SolidModelOffsetDirectionType.SURFACE_NORMAL), ("skip_elements_without_plies", True), ("drop_off_material", model.create_material()), ("cut_off_material", model.create_material()), diff --git a/tests/unittests/test_spherical_selection_rule.py b/tests/unittests/test_spherical_selection_rule.py index fa8212d93b..fa71608fac 100644 --- a/tests/unittests/test_spherical_selection_rule.py +++ b/tests/unittests/test_spherical_selection_rule.py @@ -50,8 +50,8 @@ def default_properties(): "rosette": None, "origin": (0.0, 0.0, 0.0), "radius": 0.0, - "relative_rule_type": False, - "include_rule_type": True, + "relative_rule": False, + "include_rule": True, } CREATE_METHOD_NAME = "create_spherical_selection_rule" @@ -68,8 +68,8 @@ def object_properties(parent_object): ("rosette", rosette), ("origin", (1.0, 2.0, 3.0)), ("radius", 4.0), - ("relative_rule_type", True), - ("include_rule_type", False), + ("relative_rule", True), + ("include_rule", False), ], read_only=[ ("id", "some_id"), diff --git a/tests/unittests/test_stackup.py b/tests/unittests/test_stackup.py index 04fdfb32e2..eec4c452b0 100644 --- a/tests/unittests/test_stackup.py +++ b/tests/unittests/test_stackup.py @@ -23,9 +23,9 @@ import pytest from ansys.acp.core import ( - CutoffMaterialType, - DrapingMaterialType, - DropoffMaterialType, + CutoffMaterialHandling, + DrapingMaterialModel, + DropoffMaterialHandling, FabricWithAngle, SymmetryType, ) @@ -56,11 +56,11 @@ def default_properties(): "topdown": True, "fabrics": [], "symmetry": SymmetryType.NO_SYMMETRY, - "drop_off_material_handling": DropoffMaterialType.GLOBAL, + "drop_off_material_handling": DropoffMaterialHandling.GLOBAL, "drop_off_material": None, - "cut_off_material_handling": CutoffMaterialType.COMPUTED, + "cut_off_material_handling": CutoffMaterialHandling.COMPUTED, "cut_off_material": None, - "draping_material_model": DrapingMaterialType.WOVEN, + "draping_material_model": DrapingMaterialModel.WOVEN, "draping_ud_coefficient": 0.0, } @@ -86,11 +86,11 @@ def object_properties(parent_object): ], ), ("symmetry", SymmetryType.EVEN_SYMMETRY), - ("drop_off_material_handling", DropoffMaterialType.CUSTOM), + ("drop_off_material_handling", DropoffMaterialHandling.CUSTOM), ("drop_off_material", material), - ("cut_off_material_handling", CutoffMaterialType.CUSTOM), + ("cut_off_material_handling", CutoffMaterialHandling.CUSTOM), ("cut_off_material", material), - ("draping_material_model", DrapingMaterialType.UD), + ("draping_material_model", DrapingMaterialModel.UD), ("draping_ud_coefficient", 0.55), ], read_only=[ diff --git a/tests/unittests/test_tube_selection_rule.py b/tests/unittests/test_tube_selection_rule.py index 92f7f9a0a9..c18a7b20ab 100644 --- a/tests/unittests/test_tube_selection_rule.py +++ b/tests/unittests/test_tube_selection_rule.py @@ -49,7 +49,7 @@ def default_properties(): "edge_set": None, "outer_radius": 1.0, "inner_radius": 0.0, - "include_rule_type": True, + "include_rule": True, "extend_endings": False, "symmetrical_extension": True, "head": (0.0, 0.0, 0.0), @@ -70,7 +70,7 @@ def object_properties(parent_object): ("edge_set", edge_set), ("outer_radius", 1.3), ("inner_radius", 0.3), - ("include_rule_type", False), + ("include_rule", False), ("extend_endings", True), ("symmetrical_extension", False), ("head", (1.0, 2.0, 3.0)), diff --git a/tests/unittests/test_variable_offset_selection_rule.py b/tests/unittests/test_variable_offset_selection_rule.py index 7c8dce5473..7678ccb910 100644 --- a/tests/unittests/test_variable_offset_selection_rule.py +++ b/tests/unittests/test_variable_offset_selection_rule.py @@ -52,7 +52,7 @@ def default_properties(): "edge_set": None, "offsets": None, "angles": None, - "include_rule_type": True, + "include_rule": True, "use_offset_correction": False, "element_set": None, "inherit_from_lookup_table": True, @@ -78,7 +78,7 @@ def object_properties(parent_object): ("edge_set", edge_set), ("offsets", column_1), ("angles", column_2), - ("include_rule_type", False), + ("include_rule", False), ("use_offset_correction", True), ("element_set", element_set), ("inherit_from_lookup_table", False),