Skip to content
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

Move root lattice definition to lattices dict #51

Merged
merged 12 commits into from
May 24, 2020
Merged

Conversation

felix-andreas
Copy link
Member

@felix-andreas felix-andreas commented May 3, 2020

Fixes: #19

New Structure:

{
  "version": "2.0",
  "title": "FODO Lattice",
  "info": "This is the simplest possible strong focusing lattice.",
  "root": "RING",
  "elements": {
    "D1": ["Drift", {"length": 0.55}],
    "Q1": ["Quadrupole", {"length": 0.2, "k1": 1.2}],
    "Q2": ["Quadrupole", {"length": 0.4, "k1": -1.2}],
    "B1": ["Dipole", {"length": 1.5, "angle": 0.392701, "e1": 0.1963505, "e2": 0.1963505}]
  },
  "lattices": {
    "CELL": ["Q1", "D1", "B1", "D1", "Q2", "D1", "B1", "D1", "Q1"],
    "RING": ["CELL", "CELL", "CELL", "CELL", "CELL", "CELL", "CELL", "CELL"]
  }
}

Motivation:
Sometimes it is necessary to have a dict of ALL lattices. Currently one has to write

all_lattices = {**sub_lattices, lattice}

to achieve this. I cannot come up with a case where it would be beneficial to have a dict ONLY containing sub-lattices.

This makes it also easier to generate a sub_lattice file: Just replace the "root" attribute.

Naming:
Other options for the name of the root attribute would be main, base, use (like MADX) or main_lattice.

@tomerten @PaulGoslawski Any comments?

@PaulGoslawski
Copy link
Collaborator

I would prefer to use main_lattice instead of all other proposals! All other proposals are used in other contexts. main_lattice is clearly defined.

@felix-andreas felix-andreas merged commit e9ee229 into master May 24, 2020
@felix-andreas felix-andreas deleted the new-structure branch May 24, 2020 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

main_lattice instead of sub_lattices
2 participants