Skip to content

Automatically create a Part for new Components #237

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ewuerger
Copy link
Member

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.

@Wuestengecko
Copy link
Member

Can you rebase on top of latest master (c2e00d4)? That should fix the CI.

@ewuerger ewuerger force-pushed the automatic-part-creation branch 3 times, most recently from b01ca57 to 4f86413 Compare January 31, 2023 12:15
f"Cannot instantiate {type(self).__name__} directly"
)
try:
self._xmltag = kw.pop("_xmltag")
Copy link
Member

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.

@ewuerger ewuerger force-pushed the automatic-part-creation branch from 6e4c327 to b4db0f2 Compare February 20, 2023 10:04
@Wuestengecko Wuestengecko marked this pull request as draft May 26, 2025 15:30
@Wuestengecko Wuestengecko force-pushed the automatic-part-creation branch from b4db0f2 to 6c1ffe3 Compare May 27, 2025 09:09
@Wuestengecko Wuestengecko changed the title Automatic part creation when creating a Component Automatically create a Part for new Components May 27, 2025
@Wuestengecko Wuestengecko force-pushed the automatic-part-creation branch from 6c1ffe3 to 6d9be35 Compare May 27, 2025 16:03
@Wuestengecko Wuestengecko force-pushed the automatic-part-creation branch from 6d9be35 to 570d983 Compare May 30, 2025 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Declarative modelling : Problems when declaring new functions / components
2 participants