From 9e0034ca4a697f9fc6a32571fabb8513e9c14f4e Mon Sep 17 00:00:00 2001 From: PONS Date: Fri, 1 Aug 2025 15:17:02 +0200 Subject: [PATCH 1/2] Added SkewQuad array --- pyaml/arrays/skewquad.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 pyaml/arrays/skewquad.py diff --git a/pyaml/arrays/skewquad.py b/pyaml/arrays/skewquad.py new file mode 100644 index 00000000..d744e277 --- /dev/null +++ b/pyaml/arrays/skewquad.py @@ -0,0 +1,19 @@ +from .array import ArrayModel +from .array import Array +from ..lattice.element_holder import ElementHolder,MagnetType + +# Define the main class name for this module +PYAMLCLASS = "SkewQuad" + +class ConfigModel(ArrayModel):... + +class SkewQuad(Array): + """ + Class that implements access to arrays (families) + """ + def __init__(self, cfg: ArrayModel): + super().__init__(cfg) + + def fill_array(self,holder:ElementHolder): + holder.fill_magnet_array(MagnetType.SKEWQUAD,self._cfg.name,self._cfg.elements) + From 96e8d20898407c56ed0890a228b17e8e7ee4225b Mon Sep 17 00:00:00 2001 From: PONS Date: Fri, 1 Aug 2025 15:27:53 +0200 Subject: [PATCH 2/2] Added magnet array --- pyaml/arrays/octupole.py | 19 +++++++++++++++++++ pyaml/arrays/sextupole.py | 19 +++++++++++++++++++ pyaml/arrays/skewoctu.py | 19 +++++++++++++++++++ pyaml/arrays/skewsext.py | 19 +++++++++++++++++++ 4 files changed, 76 insertions(+) create mode 100644 pyaml/arrays/octupole.py create mode 100644 pyaml/arrays/sextupole.py create mode 100644 pyaml/arrays/skewoctu.py create mode 100644 pyaml/arrays/skewsext.py diff --git a/pyaml/arrays/octupole.py b/pyaml/arrays/octupole.py new file mode 100644 index 00000000..62069847 --- /dev/null +++ b/pyaml/arrays/octupole.py @@ -0,0 +1,19 @@ +from .array import ArrayModel +from .array import Array +from ..lattice.element_holder import ElementHolder,MagnetType + +# Define the main class name for this module +PYAMLCLASS = "Octupole" + +class ConfigModel(ArrayModel):... + +class Octupole(Array): + """ + Class that implements access to arrays (families) + """ + def __init__(self, cfg: ArrayModel): + super().__init__(cfg) + + def fill_array(self,holder:ElementHolder): + holder.fill_magnet_array(MagnetType.OCTUPOLE,self._cfg.name,self._cfg.elements) + diff --git a/pyaml/arrays/sextupole.py b/pyaml/arrays/sextupole.py new file mode 100644 index 00000000..bc45aaeb --- /dev/null +++ b/pyaml/arrays/sextupole.py @@ -0,0 +1,19 @@ +from .array import ArrayModel +from .array import Array +from ..lattice.element_holder import ElementHolder,MagnetType + +# Define the main class name for this module +PYAMLCLASS = "Sextupole" + +class ConfigModel(ArrayModel):... + +class Sextupole(Array): + """ + Class that implements access to arrays (families) + """ + def __init__(self, cfg: ArrayModel): + super().__init__(cfg) + + def fill_array(self,holder:ElementHolder): + holder.fill_magnet_array(MagnetType.SEXTUPOLE,self._cfg.name,self._cfg.elements) + diff --git a/pyaml/arrays/skewoctu.py b/pyaml/arrays/skewoctu.py new file mode 100644 index 00000000..8907ccab --- /dev/null +++ b/pyaml/arrays/skewoctu.py @@ -0,0 +1,19 @@ +from .array import ArrayModel +from .array import Array +from ..lattice.element_holder import ElementHolder,MagnetType + +# Define the main class name for this module +PYAMLCLASS = "SkewOctu" + +class ConfigModel(ArrayModel):... + +class SkewOctu(Array): + """ + Class that implements access to arrays (families) + """ + def __init__(self, cfg: ArrayModel): + super().__init__(cfg) + + def fill_array(self,holder:ElementHolder): + holder.fill_magnet_array(MagnetType.SKEWOCTU,self._cfg.name,self._cfg.elements) + diff --git a/pyaml/arrays/skewsext.py b/pyaml/arrays/skewsext.py new file mode 100644 index 00000000..754e21b5 --- /dev/null +++ b/pyaml/arrays/skewsext.py @@ -0,0 +1,19 @@ +from .array import ArrayModel +from .array import Array +from ..lattice.element_holder import ElementHolder,MagnetType + +# Define the main class name for this module +PYAMLCLASS = "SkewSext" + +class ConfigModel(ArrayModel):... + +class SkewSext(Array): + """ + Class that implements access to arrays (families) + """ + def __init__(self, cfg: ArrayModel): + super().__init__(cfg) + + def fill_array(self,holder:ElementHolder): + holder.fill_magnet_array(MagnetType.SKEWSEXT,self._cfg.name,self._cfg.elements) +