Replies: 1 comment 1 reply
-
devices:
- bpms.yaml
- diag_tools.yaml
- tuning_tools.yaml
- magnets.yamlThe above has to be supported and it should be easy to fixed during list expansion: # Recursively expand a list
def expand_list(self, l: list):
idx = 0
while idx < len(l):
value = l[idx]
if hasToLoad(value):
obj = load(value, self.files_stack)
if isinstance(obj,list):
l[idx:idx+1] = obj
idx += len(obj)
else:
l[idx] = obj
idx += 1
else:
self.expand(value)
idx += 1 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Overview
The goal of this discussion is to consolidate the ongoing improvements around configuration and API design in order to maintain overall consistency. It also aims to validate key API choices early, in particular to avoid redundancy or overlap between existing concepts such as YellowPages and ElementHolder, and to ensure a coherent direction across all related developments.
This discussion focuses on improving both the configuration model and the API usability in PyAML. The goal is to simplify workflows, increase flexibility, and enable more dynamic behavior while keeping the system consistent and maintainable.
Configuration Model
Backend Linking
The configuration should rely on a key/value manager to link objects to the backend:
This approach is aligned with the catalog work introduced in PR #192 .
Workflow
The expected workflow is:
Load a static configuration
Optionally modify it dynamically:
This implies that configurations should not be considered immutable after loading.
An open question is whether dedicated tools should be introduced to help build configurations. If so, several aspects need to be clarified:
Configuration Composition and Modification
Current State
Configuration composition is already supported through multiple YAML files. However:
Proposed Improvements
1. Direct Multi-file Loading
Current state:
Configuration composition is already possible by splitting the configuration into multiple YAML files and referencing them from a main file. However, this approach has several limitations:
In particular, it is currently not possible to write something like:
or:
It is also not possible to express composition directly within YAML itself. For example, the following is not supported:
Proposed improvement:
Allow the PyAML builder to accept multiple configuration fragments directly, without requiring a pre-built main file.
This would:
2. Dynamic Post-load Modification
After loading a configuration, it should be possible to:
3. Validation and Mutability Support
To support safe dynamic updates:
This approach has already been explored in PR #214.
Benefits:
API: Access to Tools and Objects
Improving the API for accessing high-level objects is already being discussed in:
The objective is to provide:
High-Level Object Management
Introducing a manager for high-level objects could significantly improve consistency across:
Expected Benefits
Relation with Yellow Pages
The Yellow Pages concept could be extended to support this:
Beta Was this translation helpful? Give feedback.
All reactions