-
Notifications
You must be signed in to change notification settings - Fork 10
PALS: Base Structure & Version #152
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
base: main
Are you sure you want to change the base?
Conversation
This updates the PALS root structure further, as discussed in August 2025. It also adds a version attribute (schema TBD, e.g., calver or semver) to close pals-project#125.
| - drift1: | ||
| kind: Drift | ||
| length: 0.25 | ||
| PALS: |
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.
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.
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.
Discussed with @DavidSagan : We would combine files and use immediate evaluation / sets like this later on:
PALS:
version: null # later, we will put the version of the PALS standard here
imports:
- "first.pals.yaml" # adds elements to the beginning of "lattice: ..."
- "second.pals.yaml" # adds more elements (to the end of) "lattice: ..."
elements:
# elements from first.pals.yaml
# elements from second.pals.yaml
- another_drift:
kind: Drift
length: 0.25
- set: "..." # can manipulate all elementsfirst.pals.yaml and second.pals.yaml would use the same schema (PALS: version: elements: ...).
We can later on allow to sub-select a beamline in imports:, e.g., first.pals.yaml:FODO for a named BeamLine only.
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.
Rolled somehow back today, now includes use a "magic element name" like the set command:
Discussed with @DavidSagan : We would combine files and use immediate evaluation / sets like this later on:
PALS:
version: null # later, we will put the version of the PALS standard here
lattices:
- include: "first.pals.yaml" # adds elements & commands
- include: "second.pals.yaml" # adds more elements & commands
- another_drift:
kind: Drift
length: 0.25
- set: "..." # can manipulate all elementsfirst.pals.yaml and second.pals.yaml would use the same schema (PALS: version: lattices: ...).
We can later on allow to sub-select a beamline in imports:, e.g., first.pals.yaml:FODO for a named BeamLine only.
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.
My personal preference is to call this group elements:.
I do not think it is confusing if elements includes a list of elements and commands like include/set, and it is quite descriptive (vs. writing "nodes" or "objects" or "list").
PALS:
version: null # later, we will put the version of the PALS standard here
elements:
- include: "first.pals.yaml" # adds elements & commands
- another_drift:
kind: Drift
length: 0.25
- set: "..." # can manipulate all elements
- include: "second.pals.yaml" # adds more elements & commands
- my_lattice:
kind: Lattice
branches:
- ...
This comment was marked as resolved.
This comment was marked as resolved.
|
@DavidSagan I checked this quickly and it would be cleaner to keep without the list at the root level. |
|
Thanks! We agreed on the example, I will finalize the PR by updating also the |
|
Updated the written standard now, too! :) |
|
@DavidSagan just an update that I added the docs as well. Let us know if good to merge :) |
source/conventions.md
Outdated
| (s:includefiles)= | ||
| ## Include Lattice Files | ||
|
|
||
| A lattice file can include other lattices using an include statement. |
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.
The information in the include file may be anything and not restricted to a "lattice". EG: a bunch of set commands.
source/conventions.md
Outdated
| PALS: | ||
| version: null # version schema: defined later | ||
|
|
||
| include: |
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.
Also order is important so this needs to be -include.
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.
That is not correct. The elements inside include need to be sorted and thus use a list (with -), the outer key include itself does not:
It is not relevant if the key include inside the PALS group comes before/after version/lattice/other keys.
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.
I think what this boils down to is that your vision of what include does is different from mine. PALS can have both. Since there is already documentation for my version of include why don't you call your version `using'?
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.
What you want is a floating reserved element name include that includes the file somewhere in the lattices: list. This PR does not do that, but we can do that as well.
To me those are two different ways to include, I have no strong preference over one or the other. Will update.
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.
@DavidSagan take a look now
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.
Part of the problem here is that you are using the word element for a YAML key but element can also refer to
a lattice element (quadrupole, etc.) which is what I thought you were referring to. I would suggest using the word key here to avoid ambiguity.
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.
Also this PR removes the include definition already in place. This definition obviously needs elaboration but I do want to keep it since this is different from what you envision. Suggestion: Keep the existing include section in the documentation and have the PR add your section with a different name.
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.
Include: same section & usage now, I just moved it up. Moving it down again, since it seems to confuse that I moved the section to be grouped more logically.
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.
The element(s) key would just be the group where we put all elements/lattices/commands in. Thus, there would be no real ambiguity, it is just a descriptive namespace.
Magic element name without type, like `set`.
Avoid confusion.
1fc8171 to
1dd0800
Compare



This updates the PALS root structure further, as discussed in August 2025. It also adds a version attribute (schema TBD, e.g., calver or semver) to start on #125.
Checklist
Changes
Adds a root level
PALSkey, which helps to group:versionattributeconfigdictionary (later, in brainstorming so far)