|
def update_nss_from(self, other: "NamespaceSet"): |
|
""" |
|
Update a NamespaceSet from a given NamespaceSet. |
|
|
|
WARNING: By updating, the "other" NamespaceSet gets destroyed. |
|
|
|
:param other: The NamespaceSet to update from |
|
""" |
|
objects_to_add: List[_NSO] = [] # objects from the other nss to add to self |
|
objects_to_remove: List[_NSO] = [] # objects to remove from self |
|
for other_object in other: |
|
try: |
|
if isinstance(other_object, Referable): |
|
backend, case_sensitive = self._backend["id_short"] |
|
referable = backend[other_object.id_short if case_sensitive else other_object.id_short.upper()] |
|
referable.update_from(other_object) # type: ignore |
|
elif isinstance(other_object, Qualifier): |
|
backend, case_sensitive = self._backend["type"] |
|
qualifier = backend[other_object.type if case_sensitive else other_object.type.upper()] |
|
# qualifier.update_from(other_object) # TODO: What should happend here? |
|
elif isinstance(other_object, Extension): |
|
backend, case_sensitive = self._backend["name"] |
|
extension = backend[other_object.name if case_sensitive else other_object.name.upper()] |
|
# extension.update_from(other_object) # TODO: What should happend here? |
|
else: |
|
raise TypeError("Type not implemented") |
Currently basyx.aas.model.base.NamespaceSet.update_nss_from() has branches marked TODO: What should happen here?. Only the Referable branch is implemented.
The behavior for Qualifierand Extension should be defined and implemented, or at least reported back that this functionality is not present instead of silently being dropped.
basyx-python-sdk/sdk/basyx/aas/model/base.py
Lines 2116 to 2141 in 43b0c16
Currently
basyx.aas.model.base.NamespaceSet.update_nss_from()has branches markedTODO: What should happen here?. Only theReferablebranch is implemented.The behavior for
QualifierandExtensionshould be defined and implemented, or at least reported back that this functionality is not present instead of silently being dropped.