forked from ax3l/pydantic-mad
-
Notifications
You must be signed in to change notification settings - Fork 3
Comprehensive Element Update #33
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| from typing import Literal | ||
|
|
||
| from .ThickElement import ThickElement | ||
| from ._warnings import under_construction | ||
|
|
||
|
|
||
| @under_construction("ACKicker") | ||
| class ACKicker(ThickElement): | ||
| """Time varying kicker element""" | ||
|
|
||
| # Discriminator field | ||
| kind: Literal["ACKicker"] = "ACKicker" | ||
|
|
||
| # Note: ACKickerP parameter group not yet implemented |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| from typing import Literal, Optional | ||
|
|
||
| from .BaseElement import BaseElement | ||
| from ..parameters import BeamBeamParameters | ||
| from ._warnings import under_construction | ||
|
|
||
|
|
||
| @under_construction("BeamBeam") | ||
| class BeamBeam(BaseElement): | ||
| """Element for simulating colliding beams""" | ||
|
|
||
| # Discriminator field | ||
| kind: Literal["BeamBeam"] = "BeamBeam" | ||
|
|
||
| # Beam-beam-specific parameters | ||
| BeamBeamP: Optional[BeamBeamParameters] = None |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| from typing import Literal | ||
|
|
||
| from .BaseElement import BaseElement | ||
| from ._warnings import under_construction | ||
|
|
||
|
|
||
| @under_construction("BeginningEle") | ||
| class BeginningEle(BaseElement): | ||
| """Initial element at start of a branch""" | ||
|
|
||
| # Discriminator field | ||
| kind: Literal["BeginningEle"] = "BeginningEle" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| from typing import Literal, Optional | ||
|
|
||
| from .BaseElement import BaseElement | ||
| from ..parameters import ElectricMultipoleParameters, MagneticMultipoleParameters | ||
| from ._warnings import under_construction | ||
|
|
||
|
|
||
| @under_construction("Converter") | ||
| class Converter(BaseElement): | ||
| """Target to produce new species. EG: Positron converter""" | ||
|
|
||
| # Discriminator field | ||
| kind: Literal["Converter"] = "Converter" | ||
|
|
||
| # Converter-specific parameters | ||
| ElectricMultipoleP: Optional[ElectricMultipoleParameters] = None | ||
| MagneticMultipoleP: Optional[MagneticMultipoleParameters] = None |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| from typing import Literal, Optional | ||
|
|
||
| from .ThickElement import ThickElement | ||
| from ..parameters import ElectricMultipoleParameters, MagneticMultipoleParameters | ||
| from ._warnings import under_construction | ||
|
|
||
|
|
||
| @under_construction("CrabCavity") | ||
| class CrabCavity(ThickElement): | ||
| """RF crab cavity""" | ||
|
|
||
| # Discriminator field | ||
| kind: Literal["CrabCavity"] = "CrabCavity" | ||
|
|
||
| # CrabCavity-specific parameters | ||
| ElectricMultipoleP: Optional[ElectricMultipoleParameters] = None | ||
| MagneticMultipoleP: Optional[MagneticMultipoleParameters] = None |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| from typing import Literal, Optional | ||
|
|
||
| from .ThickElement import ThickElement | ||
| from ..parameters import ElectricMultipoleParameters, MagneticMultipoleParameters | ||
| from ._warnings import under_construction | ||
|
|
||
|
|
||
| @under_construction("EGun") | ||
| class EGun(ThickElement): | ||
| """Electron gun""" | ||
|
|
||
| # Discriminator field | ||
| kind: Literal["EGun"] = "EGun" | ||
|
|
||
| # EGun-specific parameters | ||
| ElectricMultipoleP: Optional[ElectricMultipoleParameters] = None | ||
| MagneticMultipoleP: Optional[MagneticMultipoleParameters] = None |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| from typing import Literal | ||
|
|
||
| from .BaseElement import BaseElement | ||
| from ._warnings import under_construction | ||
|
|
||
|
|
||
| @under_construction("Feedback") | ||
| class Feedback(BaseElement): | ||
| """Element used to simulate a feedback circuit""" | ||
|
|
||
| # Discriminator field | ||
| kind: Literal["Feedback"] = "Feedback" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| from typing import Literal | ||
|
|
||
| from .BaseElement import BaseElement | ||
| from ._warnings import under_construction | ||
|
|
||
|
|
||
| @under_construction("Fiducial") | ||
| class Fiducial(BaseElement): | ||
| """Global coordinate system fiducial point""" | ||
|
|
||
| # Discriminator field | ||
| kind: Literal["Fiducial"] = "Fiducial" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| from typing import Literal, Optional | ||
|
|
||
| from .BaseElement import BaseElement | ||
| from ..parameters import FloorShiftParameters | ||
|
|
||
|
|
||
| class FloorShift(BaseElement): | ||
| """Global coordinates shift element""" | ||
|
|
||
| # Discriminator field | ||
| kind: Literal["FloorShift"] = "FloorShift" | ||
|
|
||
| # Floor shift-specific parameters | ||
| FloorShiftP: Optional[FloorShiftParameters] = None |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| from typing import Literal | ||
|
|
||
| from .BaseElement import BaseElement | ||
| from ._warnings import under_construction | ||
|
|
||
|
|
||
| @under_construction("Foil") | ||
| class Foil(BaseElement): | ||
| """Material that can strip electrons from a particle. Will also cause energy loss and diffusion""" | ||
|
|
||
| # Discriminator field | ||
| kind: Literal["Foil"] = "Foil" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| from typing import Literal, Optional | ||
|
|
||
| from .BaseElement import BaseElement | ||
| from ..parameters import ForkParameters | ||
| from ._warnings import under_construction | ||
|
|
||
|
|
||
| @under_construction("Fork") | ||
| class Fork(BaseElement): | ||
| """Element used to connect lattice branches together""" | ||
|
|
||
| # Discriminator field | ||
| kind: Literal["Fork"] = "Fork" | ||
|
|
||
| # Fork-specific parameters | ||
| ForkP: Optional[ForkParameters] = None |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| from typing import Literal | ||
|
|
||
| from .BaseElement import BaseElement | ||
| from ._warnings import under_construction | ||
|
|
||
|
|
||
| @under_construction("Girder") | ||
| class Girder(BaseElement): | ||
| """Element to support in space a group of other elements""" | ||
|
|
||
| # Discriminator field | ||
| kind: Literal["Girder"] = "Girder" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| from typing import Literal, Optional | ||
|
|
||
| from .ThickElement import ThickElement | ||
| from ..parameters import ElectricMultipoleParameters, MagneticMultipoleParameters | ||
| from ._warnings import under_construction | ||
|
|
||
|
|
||
| @under_construction("Instrument") | ||
| class Instrument(ThickElement): | ||
| """Measurement element""" | ||
|
|
||
| # Discriminator field | ||
| kind: Literal["Instrument"] = "Instrument" | ||
|
|
||
| # Instrument-specific parameters | ||
| ElectricMultipoleP: Optional[ElectricMultipoleParameters] = None | ||
| MagneticMultipoleP: Optional[MagneticMultipoleParameters] = None |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| from typing import Literal, Optional | ||
|
|
||
| from .ThickElement import ThickElement | ||
| from ..parameters import ElectricMultipoleParameters, MagneticMultipoleParameters | ||
| from ._warnings import under_construction | ||
|
|
||
|
|
||
| @under_construction("Kicker") | ||
| class Kicker(ThickElement): | ||
| """Particle kicker element""" | ||
|
|
||
| # Discriminator field | ||
| kind: Literal["Kicker"] = "Kicker" | ||
|
|
||
| # Kicker-specific parameters | ||
| ElectricMultipoleP: Optional[ElectricMultipoleParameters] = None | ||
| MagneticMultipoleP: Optional[MagneticMultipoleParameters] = None |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| from typing import Literal | ||
|
|
||
| from .BaseElement import BaseElement | ||
| from ._warnings import under_construction | ||
|
|
||
|
|
||
| @under_construction("Marker") | ||
| class Marker(BaseElement): | ||
| """Zero length element to mark a particular position""" | ||
|
|
||
| # Discriminator field | ||
| kind: Literal["Marker"] = "Marker" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| from typing import Literal, Optional | ||
|
|
||
| from .ThickElement import ThickElement | ||
| from ..parameters import ElectricMultipoleParameters, MagneticMultipoleParameters | ||
| from ._warnings import under_construction | ||
|
|
||
|
|
||
| @under_construction("Mask") | ||
| class Mask(ThickElement): | ||
| """Collimation element""" | ||
|
|
||
| # Discriminator field | ||
| kind: Literal["Mask"] = "Mask" | ||
|
|
||
| # Mask-specific parameters | ||
| ElectricMultipoleP: Optional[ElectricMultipoleParameters] = None | ||
| MagneticMultipoleP: Optional[MagneticMultipoleParameters] = None |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| from typing import Literal | ||
|
|
||
| from .BaseElement import BaseElement | ||
| from ._warnings import under_construction | ||
|
|
||
|
|
||
| @under_construction("Match") | ||
| class Match(BaseElement): | ||
| """Orbit, Twiss, and dispersion matching element""" | ||
|
|
||
| # Discriminator field | ||
| kind: Literal["Match"] = "Match" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 will remove this in a follow-up PR: we do not want to expose mixin classes as real element in a concrete
BeamLine. I already update the tests accordingly.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.
With #40