Skip to content

Commit 5337955

Browse files
author
Leon Huang
committed
Removed AASd-120
1 parent 26b5bc7 commit 5337955

File tree

4 files changed

+0
-21
lines changed

4 files changed

+0
-21
lines changed

sdk/basyx/aas/model/base.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -808,9 +808,6 @@ def _set_id_short(self, id_short: Optional[NameType]):
808808
raise AASConstraintViolation(117, f"id_short of {self!r} cannot be unset, since it is already "
809809
f"contained in {self.parent!r}")
810810
from .submodel import SubmodelElementList
811-
if isinstance(self.parent, SubmodelElementList):
812-
raise AASConstraintViolation(120, f"id_short of {self!r} cannot be set, because it is "
813-
f"contained in a {self.parent!r}")
814811
for set_ in self.parent.namespace_element_sets:
815812
if set_.contains_id("id_short", id_short):
816813
raise AASConstraintViolation(22, "Object with id_short '{}' is already present in the parent "

sdk/basyx/aas/model/submodel.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -740,9 +740,6 @@ def __init__(self,
740740
raise
741741

742742
def _generate_id_short(self, new: _SE) -> None:
743-
if new.id_short is not None:
744-
raise base.AASConstraintViolation(120, "Objects with an id_short may not be added to a "
745-
f"SubmodelElementList, got {new!r} with id_short={new.id_short}")
746743
# Generate a unique id_short when a SubmodelElement is added, because children of a SubmodelElementList may not
747744
# have an id_short. The alternative would be making SubmodelElementList a special kind of base.Namespace without
748745
# a unique attribute for child-elements (which contradicts the definition of a Namespace).

sdk/docs/source/constraints.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ an :class:`~basyx.aas.model.base.AASConstraintViolation` will be raised
3636
.. |aasd117| replace:: ``idShort`` of non-identifiable ``Referables`` not being a direct child of a ``SubmodelElementList`` shall be specified.
3737
.. |aasd118| replace:: If a supplemental semantic ID (``HasSemantics/supplementalSemanticId``) is defined, there shall also be a main semantic ID (``HasSemantics/semanticId``).
3838
.. |aasd119| replace:: If any ``Qualifier/kind`` value of a ``Qualifiable/qualifier`` is equal to ``TemplateQualifier`` and the qualified element inherits from ``HasKind``, the qualified element shall be of kind ``Template`` (``HasKind/kind = Template``).
39-
.. |aasd120| replace:: ``idShort`` of submodel elements being a direct child of a ``SubmodelElementList`` shall not be specified.
4039
.. |aasd121| replace:: For ``References``, the value of ``Key/type`` of the first ``key`` of ``Reference/keys`` shall be one of ``GloballyIdentifiables``.
4140
.. |aasd122| replace:: For external references, i.e. ``References`` with ``Reference/type = ExternalReference``, the value of ``Key/type`` of the first key of ``Reference/keys`` shall be one of ``GenericGloballyIdentifiables``.
4241
.. |aasd123| replace:: For model references, i.e. ``References`` with ``Reference/type = ModellReference``, the value of ``Key/type`` of the first ``key`` of ``Reference/keys`` shall be one of ``AasIdentifiables``.
@@ -86,7 +85,6 @@ an :class:`~basyx.aas.model.base.AASConstraintViolation` will be raised
8685
AASd-117, |aasd117|, ✅,
8786
AASd-118, |aasd118|, ✅,
8887
AASd-119, |aasd119|, ❌, See `#119 <https://github.com/eclipse-basyx/basyx-python-sdk/issues/119>`__
89-
AASd-120, |aasd120|, ✅,
9088
AASd-121, |aasd121|, ✅,
9189
AASd-122, |aasd122|, ✅,
9290
AASd-123, |aasd123|, ✅,

sdk/test/model/test_submodel.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -232,19 +232,6 @@ def test_constraints(self):
232232
mlp2.semantic_id = semantic_id1
233233
model.SubmodelElementList("test_list", model.MultiLanguageProperty, [mlp1, mlp2])
234234

235-
# AASd-120
236-
mlp = model.MultiLanguageProperty("mlp")
237-
with self.assertRaises(model.AASConstraintViolation) as cm:
238-
model.SubmodelElementList("test_list", model.MultiLanguageProperty, [mlp])
239-
self.assertEqual("Objects with an id_short may not be added to a SubmodelElementList, got "
240-
"MultiLanguageProperty[mlp] with id_short=mlp (Constraint AASd-120)", str(cm.exception))
241-
mlp.id_short = None
242-
model.SubmodelElementList("test_list", model.MultiLanguageProperty, [mlp])
243-
with self.assertRaises(model.AASConstraintViolation) as cm:
244-
mlp.id_short = "mlp"
245-
self.assertEqual("id_short of MultiLanguageProperty[test_list[0]] cannot be set, because it is "
246-
"contained in a SubmodelElementList[test_list] (Constraint AASd-120)", str(cm.exception))
247-
248235
def test_aasd_108_add_set(self):
249236
prop = model.Property(None, model.datatypes.Int)
250237
mlp1 = model.MultiLanguageProperty(None)

0 commit comments

Comments
 (0)