Skip to content

Commit

Permalink
style check
Browse files Browse the repository at this point in the history
  • Loading branch information
roosre committed Nov 28, 2023
1 parent bfbb4a1 commit 4ee9eec
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/ansys/dpf/composites/_composite_model_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ def get_layup_operator(self, composite_definition_label: Optional[str] = None) -
return self._layup_provider

@property
def layup_model_type(self):
def layup_model_type(self) -> LayupModelModelContextType:
"""Get the context type of the lay-up model.
Type can be one of the following values: ``NOT_AVAILABLE``, ``ACP``, ``RST``, ``MIXED``.
Expand Down Expand Up @@ -776,7 +776,7 @@ def _first_composite_definition_label_if_only_one(self) -> str:
)

# Whether the reference surface operators are available or supported by the server
def _supports_reference_surface_operators(self):
def _supports_reference_surface_operators(self) -> bool:
if not version_equal_or_later(self._server, "8.0"):
return False

Expand Down
3 changes: 2 additions & 1 deletion src/ansys/dpf/composites/_composite_model_impl_2023r2.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
ElementInfo,
LayerProperty,
LayupPropertiesProvider,
LayupModelModelContextType,
add_layup_info_to_mesh,
get_element_info_provider,
)
Expand Down Expand Up @@ -220,7 +221,7 @@ def get_layup_operator(self, composite_definition_label: Optional[str] = None) -
return self._composite_infos[composite_definition_label].layup_provider

@property
def layup_model_type(self):
def layup_model_type(self) -> LayupModelModelContextType:
"""Get the context type of the lay-up model."""
raise NotImplementedError(
"layup_model_type is not implemented"
Expand Down
4 changes: 2 additions & 2 deletions src/ansys/dpf/composites/composite_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from .composite_scope import CompositeScope
from .data_sources import CompositeDataSources, ContinuousFiberCompositesFiles
from .failure_criteria import CombinedFailureCriterion
from .layup_info import ElementInfo, LayerProperty
from .layup_info import ElementInfo, LayerProperty, LayupModelModelContextType
from .layup_info.material_operators import MaterialOperators
from .layup_info.material_properties import MaterialProperty
from .result_definition import FailureMeasureEnum
Expand Down Expand Up @@ -142,7 +142,7 @@ def get_layup_operator(self, composite_definition_label: Optional[str] = None) -
return self._implementation.get_layup_operator(composite_definition_label)

@property
def layup_model_type(self):
def layup_model_type(self) -> LayupModelModelContextType
"""Get the context type of the lay-up model.
The type specifies whether the lay-up data was loaded from an ACP model, RST, or both.
Expand Down
3 changes: 2 additions & 1 deletion src/ansys/dpf/composites/layup_info/_layup_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,13 @@ def _get_analysis_ply(mesh: MeshedRegion, name: str, skip_check: bool = False) -

def _get_layup_model_context(layup_provider: dpf.Operator) -> int:
"""Get the lay-up model context from the lay-up provider."""
return layup_provider.get_output(218, int)
return cast(int, layup_provider.get_output(218, int))


# Note: must be in sync with the LayupModelContextTypeEnum in the C++ code
class LayupModelModelContextType(Enum):
"""Specifi"""

NOT_AVAILABLE = 0 # no layup data
ACP = 1 # lay-up data was read from ACP
RST = 2 # lay-up data was read from RST
Expand Down

0 comments on commit 4ee9eec

Please sign in to comment.