-
Notifications
You must be signed in to change notification settings - Fork 12
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
Automatic part creation when creating a Component #237
base: master
Are you sure you want to change the base?
Conversation
Can you rebase on top of latest master (c2e00d4)? That should fix the CI. |
b01ca57
to
4f86413
Compare
capellambse/model/common/element.py
Outdated
f"Cannot instantiate {type(self).__name__} directly" | ||
) | ||
try: | ||
self._xmltag = kw.pop("_xmltag") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This smells. _xmltag
is set as class variable (more like "class constant") in subclasses. We should stay consistent in treating it like that.
Besides, we don't even need it outside of __init__
anyway, and even if, it would be saved implicitly as _element.tag
.
- Added an optional `class_` parameter to RoleTagAccessor such that `.parts` wouldn't include `Port`s in its list due to matching role-tag "ownedFeatures". - Added a test case for component creation audit events. - Also fxed `cs.Part`s name: Now these take their name from their `.type` instead of their own `name` attribute in the XML code.
Setting a name on the `Part` is only allowed during creation. Else this won't have any effect since its inferred from its `.type`. The user should be informed about it.
Co-authored-by: Martin Lehmann <[email protected]>
6e4c327
to
b4db0f2
Compare
This PR implements the
cs.Part
creation of at least one part when creating a new Component. The name of the Part is now correctly inferred from its type.