Skip to content

feat: allow dynamic includes - #196

Open
shihab-dls wants to merge 2 commits into
mainfrom
dynamic_ibek_children
Open

feat: allow dynamic includes#196
shihab-dls wants to merge 2 commits into
mainfrom
dynamic_ibek_children

Conversation

@shihab-dls

Copy link
Copy Markdown
Contributor

This PR allows Include components to be set to dynamic=True, wherein they may be resolved after ibek generation of sub-entities.

Defining:

  - type: Include
    file_name: parent
    dynamic: true

stores the position of this include, and replaces it with an IgnoredComponent. Upon calling resolve_dynamic_children, if a serialized parent.pvi.device.yaml this is replaces with a dynamic=false Include and expanded, otherwise it is left as an IgnoredComponent.

This is related to this ibek PR

@shihab-dls
shihab-dls requested a review from coretl June 2, 2026 11:06
"title": "In Subscreen",
"type": "boolean"
},
"dynamic": {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if optional or allow_missing would be a clearer name?

Comment thread src/pvi/device.py
resolved: list[ComponentUnion] = []
include_components = find_components(component.file_name, yaml_paths)
if component.dynamic:
# Track this dynamic include at its position in final components list

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Temporarily ignore then put it back afterwards seems like an architectural issue, I guess this would be solved with a bigger refactor (later) like you were mentioning in person.

Comment thread src/pvi/device.py
resolved.extend(
self.expand_includes(Include(file_name=name), yaml_paths)
)
continue # Skip dynamic include, leaving it as an IgnoredComponent

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand this comment

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.

2 participants