Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

model.base: fix Referable.__repr__() for SubmodelElementList-children #129

Conversation

jkhsjdhjs
Copy link
Contributor

Since AASd-120 prohibits specifying id_shorts of direct children of
SubmodelElementLists, this commit adjusts Referable.__repr__() such
that the index of the element in the corresponding list is returned
instead.
Furthermore, the tests are adjusted accordingly.

…dren

Since AASd-120 prohibits specifying id_shorts of direct children of
`SubmodelElementLists`, this commit adjusts `Referable.__repr__()` such
that the index of the element in the corresponding list is returned
instead.
Furthermore, the tests are adjusted accordingly.
…ue` attribute has been assigned

This fixes an `AttributeError` previously raised during initialization
of a `SubmodelElementList`, since the `check_constraints` function,
which is called for every added item, may call `Referable.__repr__()`
when the `value` attribute isn't set yet. The `AttributeError` occured
because `Referable.__repr__()` accesses the `value` attribute for direct
children of a `SubmodelElementList` (1aa0e82).
This is worked around by first assigning the `OrderedNamespaceSet` to
the `value`-attribute and then adding each item separately.
@jkhsjdhjs jkhsjdhjs mentioned this pull request Oct 2, 2023
@s-heppner
Copy link
Contributor

Looks good to me

@s-heppner s-heppner merged commit 6b4fd27 into eclipse-basyx:improve/V30 Oct 3, 2023
6 checks passed
@s-heppner s-heppner deleted the fix/referable_repr_for_submodel_element_lists branch October 3, 2023 10:56
@s-heppner s-heppner added the v3.0 label Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants