Skip to content

Commit

Permalink
V3.1: Remove AASd-090
Browse files Browse the repository at this point in the history
Since `Referable.category` has been deprecated in
the metamodel, we remove the now unnecessary
invariant `AASd-090` about
`Data_element.category`.

See [aas-specs#514].

[aas-specs#514]: admin-shell-io/aas-specs#514
  • Loading branch information
s-heppner committed Jan 13, 2025
1 parent a1cc962 commit 777cec0
Showing 1 changed file with 0 additions and 33 deletions.
33 changes: 0 additions & 33 deletions aas_core_meta/v3_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -2954,26 +2954,8 @@ def __init__(
self.value = value


Valid_categories_for_data_element: Set[str] = constant_set(
values=[
"CONSTANT",
"PARAMETER",
"VARIABLE",
],
description="""\
Categories for :class:`Data_element` as defined in :constraintref:`AASd-090`""",
)


# fmt: off
@abstract
@invariant(
lambda self:
not (self.category is not None)
or self.category in Valid_categories_for_data_element,
"Constraint AASd-090: For data elements category shall be one "
"of the following values: CONSTANT, PARAMETER or VARIABLE.",
)
# fmt: on
class Data_element(Submodel_element):
"""
Expand All @@ -2982,13 +2964,6 @@ class Data_element(Submodel_element):
A data element is a submodel element that has a value. The type of value differs
for different subtypes of data elements.
:constraint AASd-090:
For data elements :attr:`category` shall be one of the following
values: ``CONSTANT``, ``PARAMETER`` or ``VARIABLE``.
Default: ``VARIABLE``
"""

def __init__(
Expand Down Expand Up @@ -3018,14 +2993,6 @@ def __init__(
embedded_data_specifications=embedded_data_specifications,
)

@implementation_specific
@non_mutating
@ensure(lambda result: result in Valid_categories_for_data_element)
def category_or_default(self) -> str:
# NOTE (mristin, 2022-04-7):
# This implementation will not be transpiled, but is given here as reference.
return self.category if self.category is not None else "VARIABLE"


# fmt: off
@invariant(
Expand Down

0 comments on commit 777cec0

Please sign in to comment.