Skip to content

Commit

Permalink
Update the README file and minor change in CAVITE.
Browse files Browse the repository at this point in the history
Signed-off-by: Cédric Hernalsteens <[email protected]>
  • Loading branch information
chernals committed Aug 6, 2020
1 parent 2ebf5db commit 8e9c942
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 10 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,23 @@ pkg_resources.resource_listdir("zgoubi_metadata", "data/elements_yaml/")
drift_yaml = pkg_resources.resource_string("zgoubi_metadata", "data/elements_yaml/DRIFT.yaml")
```

## Definition of Zgoubi elements in YAML

The [`YAML` format, https://yaml.org] ("YAML is a human friendly data serialization standard for all programming languages.") has been chosen for its simplicity and for its ability to be read from any other language. Great
libraries and support exists in `C`, `C++`, `Javasript`, many others, and of course `python`.

Each Zgoubi element is defined in a `YAML` *document*. A `YAML` file consists either of a single (implicit) document or
of multiple documents. For simplicity, this repository describes each element in a separate `YAML` file with a single
implicit document. The document contains a mapping with the following keys:

- **zgoubi_name**: the keyword of the element as defined by Zgoubi
- **params**: the parameters of the element. See below.
- **template**:
- **cond_sections**:
- **subelements**:
- **doc**:


It contains a nested mapping. Each key is the name of a parameter while
the values are mappins
20 changes: 10 additions & 10 deletions zgoubi_metadata/data/elements_yaml/CAVITE.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
zgoubi_name: CAVITE
params:
- IOPT: {type: E, unit: "", default: 0, doc: ""}
- X: {type: E, unit: "", default: 0, doc: ""}
- L: {type: E, unit: "", default: 0, doc: ""}
- H: {type: E, unit: "", default: 0, doc: ""}
- V: {type: E, unit: "", default: 0, doc: ""}
- sig_s: {type: E, unit: "", default: 0, doc: ""}
IOPT: {type: E, unit: "", default: 0, doc: ""}
X: {type: E, unit: "", default: 0, doc: ""}
L: {type: E, unit: "", default: 0, doc: ""}
H: {type: E, unit: "", default: 0, doc: ""}
V: {type: E, unit: "", default: 0, doc: ""}
sig_s: {type: E, unit: "", default: 0, doc: ""}
template:
- - IOPT
- - cond_section
- - IOPT
- - !!set {cond_section}
cond_section:
- key: IOPT
equals: 0
Expand All @@ -18,7 +18,7 @@ cond_section:
- key: IOPT
equals: 1
template:
- - L
- - !!str L
- h
- - V
- X
Expand All @@ -43,4 +43,4 @@ cond_section:
- h
- - V
- sig_s
doc: |
doc: |

0 comments on commit 8e9c942

Please sign in to comment.