Skip to content

Commit

Permalink
Harmonize enum and enum-parameter names
Browse files Browse the repository at this point in the history
  • Loading branch information
greschd committed Nov 7, 2024
1 parent 55bd01f commit 9a9beb0
Show file tree
Hide file tree
Showing 31 changed files with 180 additions and 196 deletions.
12 changes: 6 additions & 6 deletions doc/source/api/enum_types.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -37,7 +37,7 @@ Enumeration data types
LookUpTableColumnValueType
MeshImportType
NodalDataType
OffsetDirectionType
SolidModelOffsetDirectionType
OffsetType
SnapToGeometryOrientationType
PlyCutoffType
Expand All @@ -51,7 +51,7 @@ Enumeration data types
SolidModelExportFormat
SolidModelImportFormat
SolidModelSkinExportFormat
StatusType
Status
StressStateType
SymmetryType
ThicknessFieldType
Expand Down
2 changes: 1 addition & 1 deletion examples/007_direction_definitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down
24 changes: 12 additions & 12 deletions src/ansys/acp/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
CADGeometry,
CutOffGeometry,
CutOffGeometryOrientationType,
CutoffMaterialType,
CutoffMaterialHandling,
CutoffRuleType,
CutoffSelectionRule,
CutoffSelectionRuleElementalData,
Expand All @@ -63,9 +63,9 @@
CylindricalSelectionRuleElementalData,
CylindricalSelectionRuleNodalData,
DimensionType,
DrapingMaterialType,
DrapingMaterialModel,
DrapingType,
DropoffMaterialType,
DropoffMaterialHandling,
DropOffSettings,
DropOffType,
EdgeSet,
Expand All @@ -77,7 +77,7 @@
ElementTechnology,
ExtrusionGuide,
ExtrusionGuideType,
ExtrusionMethodType,
ExtrusionMethod,
ExtrusionType,
Fabric,
FabricWithAngle,
Expand Down Expand Up @@ -122,7 +122,6 @@
ModelingPlyNodalData,
ModelNodalData,
NodalDataType,
OffsetDirectionType,
OffsetType,
OrientedSelectionSet,
OrientedSelectionSetElementalData,
Expand Down Expand Up @@ -158,12 +157,13 @@
SolidModelExportSettings,
SolidModelImportFormat,
SolidModelNodalData,
SolidModelOffsetDirectionType,
SolidModelSkinExportFormat,
SphericalSelectionRule,
SphericalSelectionRuleElementalData,
SphericalSelectionRuleNodalData,
Stackup,
StatusType,
Status,
StressStateType,
SubLaminate,
SubShape,
Expand Down Expand Up @@ -207,7 +207,7 @@
"ConnectLaunchConfig",
"CutOffGeometry",
"CutOffGeometryOrientationType",
"CutoffMaterialType",
"CutoffMaterialHandling",
"CutoffRuleType",
"CutoffSelectionRule",
"CutoffSelectionRuleElementalData",
Expand All @@ -218,9 +218,9 @@
"DimensionType",
"DirectLaunchConfig",
"DockerComposeLaunchConfig",
"DrapingMaterialType",
"DrapingMaterialModel",
"DrapingType",
"DropoffMaterialType",
"DropoffMaterialHandling",
"DropOffSettings",
"DropOffType",
"EdgeSet",
Expand All @@ -233,7 +233,7 @@
"example_helpers",
"ExtrusionGuide",
"ExtrusionGuideType",
"ExtrusionMethodType",
"ExtrusionMethod",
"ExtrusionType",
"Fabric",
"FabricWithAngle",
Expand Down Expand Up @@ -286,7 +286,7 @@
"ModelingPlyNodalData",
"ModelNodalData",
"NodalDataType",
"OffsetDirectionType",
"SolidModelOffsetDirectionType",
"OffsetType",
"OrientedSelectionSet",
"OrientedSelectionSetElementalData",
Expand Down Expand Up @@ -329,7 +329,7 @@
"SphericalSelectionRuleElementalData",
"SphericalSelectionRuleNodalData",
"Stackup",
"StatusType",
"Status",
"StressStateType",
"SubLaminate",
"SubShape",
Expand Down
24 changes: 12 additions & 12 deletions src/ansys/acp/core/_tree_objects/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -70,7 +70,6 @@
LookUpTableColumnValueType,
MeshImportType,
NodalDataType,
OffsetDirectionType,
OffsetType,
PlyCutoffType,
PlyGeometryExportFormat,
Expand All @@ -82,8 +81,9 @@
SensorType,
SnapToGeometryOrientationType,
SolidModelExportFormat,
SolidModelOffsetDirectionType,
SolidModelSkinExportFormat,
StatusType,
Status,
StressStateType,
SymmetryType,
ThicknessFieldType,
Expand Down Expand Up @@ -183,7 +183,7 @@
"CADGeometry",
"CutOffGeometry",
"CutOffGeometryOrientationType",
"CutoffMaterialType",
"CutoffMaterialHandling",
"CutoffRuleType",
"CutoffSelectionRule",
"CutoffSelectionRuleElementalData",
Expand All @@ -192,9 +192,9 @@
"CylindricalSelectionRuleElementalData",
"CylindricalSelectionRuleNodalData",
"DimensionType",
"DrapingMaterialType",
"DrapingMaterialModel",
"DrapingType",
"DropoffMaterialType",
"DropoffMaterialHandling",
"DropOffSettings",
"DropOffType",
"EdgeSet",
Expand All @@ -206,7 +206,7 @@
"ElementTechnology",
"ExtrusionGuide",
"ExtrusionGuideType",
"ExtrusionMethodType",
"ExtrusionMethod",
"ExtrusionType",
"Fabric",
"FabricWithAngle",
Expand Down Expand Up @@ -253,7 +253,7 @@
"ModelingPlyNodalData",
"ModelNodalData",
"NodalDataType",
"OffsetDirectionType",
"SolidModelOffsetDirectionType",
"OffsetType",
"OrientedSelectionSet",
"OrientedSelectionSetElementalData",
Expand Down Expand Up @@ -295,7 +295,7 @@
"SphericalSelectionRuleElementalData",
"SphericalSelectionRuleNodalData",
"Stackup",
"StatusType",
"Status",
"StressStateType",
"SubLaminate",
"SubShape",
Expand Down
4 changes: 2 additions & 2 deletions src/ansys/acp/core/_tree_objects/_grpc_helpers/mapping.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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__}."
)
Expand Down
10 changes: 4 additions & 6 deletions src/ansys/acp/core/_tree_objects/boolean_selection_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
Expand All @@ -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)
Expand All @@ -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)
18 changes: 8 additions & 10 deletions src/ansys/acp/core/_tree_objects/cylindrical_selection_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
"""
Expand All @@ -114,17 +114,17 @@ 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
self.rosette = rosette
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)
Expand All @@ -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)
Loading

0 comments on commit 9a9beb0

Please sign in to comment.