Replies: 9 comments 75 replies
-
|
I don't understand why a YellowPages layer is required ? |
Beta Was this translation helpful? Give feedback.
-
|
It will take a while for me to have a detailed look at it because I have a backlog of maintenance I need to do first with MML and our cluster :/ Anyway, for me the yellow pages should be one layer up. So not But I like I think the name yellow pages is not good. I already heard several people who has no intuitive feeling for what that means. I think it would be better to call it something like registry, catalog or config_manager. Some name that is easier to understand also for those who aren't familiar with old phone books where there was yellow pages. Also, if there is |
Beta Was this translation helpful? Give feedback.
-
|
I think the information functionality of the yellow pages is more important than using it to extract the devices. At the workshop I saw that many people looked inside the yaml file to understand what had been configured, which modes where available, names of arrays etc. Then people got confused because the yaml file was long and difficult to browse. And that will also not work in the future when some labs instead of the yaml file reads the config directly from a database. So we need some functionality which allows the user to see and understand what the configuration is so they later can make use if it. That's how I understood the purpose of the yellow pages. Like the phone book where I use it to look up who I want to call but not actually to call them. But maybe that's only how I understood it? |
Beta Was this translation helpful? Give feedback.
-
@JeanLucPons In case you don't already know because @simoneliuzzo also doesn't seem to know this? |
Beta Was this translation helpful? Give feedback.
-
|
Thanks @gupichon for the proposition. Here my very "user-oriented" view on the subject, I will try to describe the problem I would like to solve and explain why I think the present implementation does not provide this. The problemAs a user, I would like to have an easy and direct access to:
These arrays should be directly exposed as properties and not obtained using their string name, so: A few other important points :
If this can be done with Why the present implementation needs to be improvedWhen you are a fresh pyAML user, most probably you never looked at the configuration (somebody set it up for you) so you don't know or remember the array names. Initialization is fine: Now how do I get my "master array" with everything so I can use the sorting features? I needed help from Vadim to figure it out ... This "master" array is the basis from which you can create new array on the fly, so for me it should be easily available as property. How can I access an predefined array in configuration? I need to know both the array name "HCOR" and the "type" of the array If it is accessible as property somewhere it is much easier. Also there are already 29 |
Beta Was this translation helpful? Give feedback.
-
|
@gupichon Can you perhaps explain a bit more what this means? If I understand it correctly it is a question about different ways the arrays could be defined and implemented?
|
Beta Was this translation helpful? Give feedback.
-
|
OK, many thanks to all for your contributions. |
Beta Was this translation helpful? Give feedback.
-
Consolidated proposalsFollowing the discussion, the perspective is now the following: YellowPages
Array creationArrays are created at the Accelerator level to ensure consistency across all control modes. Creation supports:
All control modes receive the same arrays. Open discussion: optionally allow Configuration extensionAllow declaring arrays in the configuration using (simplified examples): arrays:
- name: BPMCell04
wildcards: "BPM*-C04*"
- name: BPMCell04_regex
regex: "^BPM-C04"
- name: MyExplicitArray
ids: ["BPM_C04-01", "BPM_C04-02"]
- name: OrbitCorrectors
expr: "HCORR | VCORR"
- name: Cell04Quads
expr: "(QF* | QD*) & re:.*-C04-.*"
- name: ActiveQuads
expr: "AllQuads - DisabledQuads"Supported mechanisms:
This extends the existing ID-based array definition mechanism to allow declarative, composable array definitions directly in configuration. ElementHolder API enrichmentExtend
Add: holder.get(query: str)
holder[query] # aliasReturns:
Typed sub-holders in
|
Beta Was this translation helpful? Give feedback.
-
|
@gupichon @JeanLucPons I think it is OK to proceed to creating specific issues and continuing some discussion there whenever necessary. Do you agree?
I would personally even say that the ElementHolder API is a more important issue. But it can be started with YellowPages as @JeanLucPons suggested. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Context / Motivation
In practice, elements are addressed through different naming conventions. PyAML already provides:
ElementHolder(single source of truth),get_elements("QForTune"), etc.),|,&,-),"hardware_name:srmag/*").Yet HLAs and user scripts frequently need a stable way to resolve logical families such as:
The PyAML specification mentions a YellowPages-like concept and dataset-based resolution. We propose implementing YellowPages as a runtime-only, auto-derived resolution layer attached to
ElementHolder, without introducing a new YAML schema or Pydantic model.Goals
post_init(),register()provides attribute/property access (ergonomicholder.<family>).Proposed API
Attached to
ElementHolder:Resolution rules (predictable)
yellow_pages.get(key)resolves in this order:ElementHolder(get_elements,get_magnets,get_bpms, …)ALL_ELEMENTS,ALL_MAGNETS, …)re:)“Properties” requirement
When a user/model registers a family name, that name should be accessible like a property:
To avoid injecting class-level descriptors, this can be implemented via:
ElementHolder.__getattr__delegating to YellowPages when a matching key exists.This provides “property-like” access without impacting other holders or requiring metaprogramming.
Why this fits PyAML
ElementHolderas the authoritative object index.Open Questions
ops,commissioning, …) as layered registries?This would make regex-derived groups first-class arrays at load time rather than runtime-only YellowPages entries.
Architectural distinction
There is a conceptual difference between:
Runtime YellowPages resolution
Dynamic, contextual, and possibly user- or model-defined. These families may depend on runtime state, peer (design/live), or HLA logic.
Configuration-defined regex arrays
Deterministic, static groups resolved during configuration loading. They behave like any other array type and become part of the ElementHolder’s intrinsic structure.
If both mechanisms are supported, we should clarify:
pyaml.array.regexis a true array type resolved at load time,Beta Was this translation helpful? Give feedback.
All reactions