-
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?
Changes from 8 commits
3e7622f
aee82f4
2254bd1
454270b
9658e1a
f4907fd
af3b1f2
da2ef1f
df5136f
431c408
1dd0800
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,32 +9,36 @@ | |
| # - definition of a FODO channel that: | ||
| # - repeats a line (fodo_cell) three times | ||
| # | ||
| - drift1: | ||
| kind: Drift | ||
| length: 0.25 | ||
| PALS: | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Discussed with @DavidSagan : We would combine files and use immediate evaluation / 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 elements
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 Discussed with @DavidSagan : We would combine files and use immediate evaluation / 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 elements
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My personal preference is to call this group 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:
- ... |
||
| version: null # later, we will put the version of the PALS standard here | ||
|
|
||
| - quad1: | ||
| kind: Quadrupole | ||
| MagneticMultipoleP: | ||
| Bn1: 1.0 | ||
| length: 1.0 | ||
|
|
||
| - fodo_cell: | ||
| kind: BeamLine | ||
| line: | ||
| - drift1 | ||
| - quad1 | ||
| - drift2: | ||
| elements: | ||
| - drift1: | ||
| kind: Drift | ||
| length: 0.5 | ||
| - quad2: | ||
| inherit: quad1 | ||
| length: 0.25 | ||
|
|
||
| - quad1: | ||
| kind: Quadrupole | ||
| MagneticMultipoleP: | ||
| Bn1: -1.0 | ||
| - drift1 | ||
|
|
||
| - fodo_channel: | ||
| kind: BeamLine | ||
| line: | ||
| Bn1: 1.0 | ||
| length: 1.0 | ||
|
|
||
| - fodo_cell: | ||
| repeat: 3 | ||
| kind: BeamLine | ||
| line: | ||
| - drift1 | ||
| - quad1 | ||
| - drift2: | ||
| kind: Drift | ||
| length: 0.5 | ||
| - quad2: | ||
| inherit: quad1 | ||
| MagneticMultipoleP: | ||
| Bn1: -1.0 | ||
| - drift1 | ||
|
|
||
| - fodo_channel: | ||
| kind: BeamLine | ||
| line: | ||
| - fodo_cell: | ||
| repeat: 3 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -83,7 +83,49 @@ associated standards, there are packages that implement translation between latt | |
| representational internal format defined by the package. | ||
|
|
||
| While the standard itself is language agnostic, this document that describes the standard | ||
| needs to use some syntax and this syntax is based upon YAML. Non-YAML syntax used here is: | ||
| needs to use some syntax and this syntax is based upon YAML. | ||
|
|
||
| %--------------------------------------------------------------------------------------------------- | ||
| (s:includefiles)= | ||
| ## PALS Root Object | ||
|
|
||
| The root of the PALS schema is given by this dictionary: | ||
| ```{code} YAML | ||
| PALS: | ||
| version: null # version schema: defined later | ||
|
|
||
| lattices: | ||
| - ... # a list of lattice elements and commands | ||
| ``` | ||
|
|
||
| %--------------------------------------------------------------------------------------------------- | ||
| (s:includefiles)= | ||
| ## Include Lattice Files | ||
|
|
||
| A lattice file can include other lattices (elements and commands) using an include statement. | ||
|
|
||
| Example: | ||
| ```{code} YAML | ||
ax3l marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| PALS: | ||
| version: null # version schema: defined later | ||
|
|
||
| include: | ||
|
||
| - "./base-lattice.pals.yaml" | ||
| - "./extra-lattice.pals.yaml" | ||
|
|
||
| lattices: | ||
| # the elements and commands of base-lattice.pals.yaml | ||
| # the elements and commands of extra-lattice.pals.yaml | ||
| - ... # a list of additional lattice elements and commands | ||
| ``` | ||
| where the include file names above are examples. | ||
| Includes simplify insert the `lattices` block of the `include` file(s) first. | ||
ax3l marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| %--------------------------------------------------------------------------------------------------- | ||
| (s:matching)= | ||
| ## Matching Syntax | ||
|
|
||
| Non-YAML syntax used here is: | ||
|
|
||
| 1. The {math}`N^{th}` item in a list is referred to using square brackets enclosing the index: `[N]`. | ||
| For example: | ||
|
|
@@ -140,16 +182,6 @@ All parameters are optional unless explicitly stated otherwise. | |
| Optional real or integer parameters have a default value of zero unless otherwise stated. | ||
| Optional string parameters have a default value of blank unless otherwise stated. | ||
|
|
||
| %--------------------------------------------------------------------------------------------------- | ||
| (s:includefiles)= | ||
| ## Include Files | ||
ax3l marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| A lattice file can include other lattice files using an include statement. | ||
| ```{code} yaml | ||
| include: <file-name> | ||
| ``` | ||
| where `<file-name>` is the name of the file to be included. | ||
|
|
||
| %--------------------------------------------------------------------------------------------------- | ||
| (s:names)= | ||
| ## Names | ||
|
|
||



Uh oh!
There was an error while loading. Please reload this page.