diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 5b15fa61..053a457c 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -36,4 +36,4 @@ python: submodules: include: all - recursive: true + recursive: true diff --git a/docs/Makefile b/docs/Makefile index d1bc1865..13882759 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -24,4 +24,4 @@ test: Makefile # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). %: Makefile - @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) \ No newline at end of file + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/docs/api/pyaml.accelerator.rst b/docs/api/pyaml.accelerator.rst index 9be534a9..cad94624 100644 --- a/docs/api/pyaml.accelerator.rst +++ b/docs/api/pyaml.accelerator.rst @@ -3,11 +3,10 @@ .. automodule:: pyaml.accelerator - + .. rubric:: Classes .. autosummary:: - + Accelerator ConfigModel - \ No newline at end of file diff --git a/docs/api/pyaml.arrays.array.rst b/docs/api/pyaml.arrays.array.rst index 29926710..58ff1334 100644 --- a/docs/api/pyaml.arrays.array.rst +++ b/docs/api/pyaml.arrays.array.rst @@ -3,11 +3,10 @@ pyaml.arrays.array .. automodule:: pyaml.arrays.array - + .. rubric:: Classes .. autosummary:: - + ArrayConfig ArrayConfigModel - \ No newline at end of file diff --git a/docs/api/pyaml.arrays.bpm.rst b/docs/api/pyaml.arrays.bpm.rst index 1ae8eeba..d3b49d5c 100644 --- a/docs/api/pyaml.arrays.bpm.rst +++ b/docs/api/pyaml.arrays.bpm.rst @@ -3,11 +3,10 @@ pyaml.arrays.bpm .. automodule:: pyaml.arrays.bpm - + .. rubric:: Classes .. autosummary:: - + BPM ConfigModel - \ No newline at end of file diff --git a/docs/api/pyaml.arrays.bpm_array.rst b/docs/api/pyaml.arrays.bpm_array.rst index 72a612c4..2c47e37a 100644 --- a/docs/api/pyaml.arrays.bpm_array.rst +++ b/docs/api/pyaml.arrays.bpm_array.rst @@ -3,12 +3,11 @@ pyaml.arrays.bpm\_array .. automodule:: pyaml.arrays.bpm_array - + .. rubric:: Classes .. autosummary:: - + BPMArray RWBPMPosition RWBPMSinglePosition - \ No newline at end of file diff --git a/docs/api/pyaml.arrays.cfm_magnet.rst b/docs/api/pyaml.arrays.cfm_magnet.rst index 43c3543f..13d0bea7 100644 --- a/docs/api/pyaml.arrays.cfm_magnet.rst +++ b/docs/api/pyaml.arrays.cfm_magnet.rst @@ -3,11 +3,10 @@ pyaml.arrays.cfm\_magnet .. automodule:: pyaml.arrays.cfm_magnet - + .. rubric:: Classes .. autosummary:: - + CombinedFunctionMagnet ConfigModel - \ No newline at end of file diff --git a/docs/api/pyaml.arrays.cfm_magnet_array.rst b/docs/api/pyaml.arrays.cfm_magnet_array.rst index b7edd03b..53993ac6 100644 --- a/docs/api/pyaml.arrays.cfm_magnet_array.rst +++ b/docs/api/pyaml.arrays.cfm_magnet_array.rst @@ -3,12 +3,11 @@ pyaml.arrays.cfm\_magnet\_array .. automodule:: pyaml.arrays.cfm_magnet_array - + .. rubric:: Classes .. autosummary:: - + CombinedFunctionMagnetArray RWMagnetHardwares RWMagnetStrengths - \ No newline at end of file diff --git a/docs/api/pyaml.arrays.element.rst b/docs/api/pyaml.arrays.element.rst index f2382849..9da6de06 100644 --- a/docs/api/pyaml.arrays.element.rst +++ b/docs/api/pyaml.arrays.element.rst @@ -3,11 +3,10 @@ pyaml.arrays.element .. automodule:: pyaml.arrays.element - + .. rubric:: Classes .. autosummary:: - + ConfigModel Element - \ No newline at end of file diff --git a/docs/api/pyaml.arrays.element_array.rst b/docs/api/pyaml.arrays.element_array.rst index df0bfad0..c1e248f8 100644 --- a/docs/api/pyaml.arrays.element_array.rst +++ b/docs/api/pyaml.arrays.element_array.rst @@ -3,10 +3,9 @@ pyaml.arrays.element\_array .. automodule:: pyaml.arrays.element_array - + .. rubric:: Classes .. autosummary:: - + ElementArray - \ No newline at end of file diff --git a/docs/api/pyaml.arrays.magnet.rst b/docs/api/pyaml.arrays.magnet.rst index e16031d1..4df9a608 100644 --- a/docs/api/pyaml.arrays.magnet.rst +++ b/docs/api/pyaml.arrays.magnet.rst @@ -3,11 +3,10 @@ pyaml.arrays.magnet .. automodule:: pyaml.arrays.magnet - + .. rubric:: Classes .. autosummary:: - + ConfigModel Magnet - \ No newline at end of file diff --git a/docs/api/pyaml.arrays.magnet_array.rst b/docs/api/pyaml.arrays.magnet_array.rst index c1dccaa5..d8c07636 100644 --- a/docs/api/pyaml.arrays.magnet_array.rst +++ b/docs/api/pyaml.arrays.magnet_array.rst @@ -3,12 +3,11 @@ pyaml.arrays.magnet\_array .. automodule:: pyaml.arrays.magnet_array - + .. rubric:: Classes .. autosummary:: - + MagnetArray RWMagnetHardware RWMagnetStrength - \ No newline at end of file diff --git a/docs/api/pyaml.arrays.rst b/docs/api/pyaml.arrays.rst index fc69793f..98b9176b 100644 --- a/docs/api/pyaml.arrays.rst +++ b/docs/api/pyaml.arrays.rst @@ -3,7 +3,7 @@ .. automodule:: pyaml.arrays - + .. rubric:: Modules .. autosummary:: diff --git a/docs/api/pyaml.arrays.serialized_magnet.rst b/docs/api/pyaml.arrays.serialized_magnet.rst index 65b7d1ae..f209116a 100644 --- a/docs/api/pyaml.arrays.serialized_magnet.rst +++ b/docs/api/pyaml.arrays.serialized_magnet.rst @@ -3,11 +3,10 @@ pyaml.arrays.serialized\_magnet .. automodule:: pyaml.arrays.serialized_magnet - + .. rubric:: Classes .. autosummary:: - + ConfigModel SerializedMagnets - \ No newline at end of file diff --git a/docs/api/pyaml.arrays.serialized_magnet_array.rst b/docs/api/pyaml.arrays.serialized_magnet_array.rst index 0d978723..c401c2b8 100644 --- a/docs/api/pyaml.arrays.serialized_magnet_array.rst +++ b/docs/api/pyaml.arrays.serialized_magnet_array.rst @@ -3,12 +3,11 @@ pyaml.arrays.serialized\_magnet\_array .. automodule:: pyaml.arrays.serialized_magnet_array - + .. rubric:: Classes .. autosummary:: - + RWMagnetHardwares RWMagnetStrengths SerializedMagnetsArray - \ No newline at end of file diff --git a/docs/api/pyaml.bpm.bpm.rst b/docs/api/pyaml.bpm.bpm.rst index d2b45ce1..4d2532d6 100644 --- a/docs/api/pyaml.bpm.bpm.rst +++ b/docs/api/pyaml.bpm.bpm.rst @@ -3,11 +3,10 @@ pyaml.bpm.bpm .. automodule:: pyaml.bpm.bpm - + .. rubric:: Classes .. autosummary:: - + BPM ConfigModel - \ No newline at end of file diff --git a/docs/api/pyaml.bpm.bpm_model.rst b/docs/api/pyaml.bpm.bpm_model.rst index 6d02b865..04e5d330 100644 --- a/docs/api/pyaml.bpm.bpm_model.rst +++ b/docs/api/pyaml.bpm.bpm_model.rst @@ -3,10 +3,9 @@ pyaml.bpm.bpm\_model .. automodule:: pyaml.bpm.bpm_model - + .. rubric:: Classes .. autosummary:: - + BPMModel - \ No newline at end of file diff --git a/docs/api/pyaml.bpm.bpm_simple_model.rst b/docs/api/pyaml.bpm.bpm_simple_model.rst index 429a7b6d..049c65d6 100644 --- a/docs/api/pyaml.bpm.bpm_simple_model.rst +++ b/docs/api/pyaml.bpm.bpm_simple_model.rst @@ -3,11 +3,10 @@ pyaml.bpm.bpm\_simple\_model .. automodule:: pyaml.bpm.bpm_simple_model - + .. rubric:: Classes .. autosummary:: - + BPMSimpleModel ConfigModel - \ No newline at end of file diff --git a/docs/api/pyaml.bpm.bpm_tiltoffset_model.rst b/docs/api/pyaml.bpm.bpm_tiltoffset_model.rst index 828a60bd..9e387af0 100644 --- a/docs/api/pyaml.bpm.bpm_tiltoffset_model.rst +++ b/docs/api/pyaml.bpm.bpm_tiltoffset_model.rst @@ -3,11 +3,10 @@ pyaml.bpm.bpm\_tiltoffset\_model .. automodule:: pyaml.bpm.bpm_tiltoffset_model - + .. rubric:: Classes .. autosummary:: - + BPMTiltOffsetModel ConfigModel - \ No newline at end of file diff --git a/docs/api/pyaml.bpm.rst b/docs/api/pyaml.bpm.rst index cf3a6ee0..6e51f37c 100644 --- a/docs/api/pyaml.bpm.rst +++ b/docs/api/pyaml.bpm.rst @@ -3,7 +3,7 @@ .. automodule:: pyaml.bpm - + .. rubric:: Modules .. autosummary:: diff --git a/docs/api/pyaml.common.abstract.rst b/docs/api/pyaml.common.abstract.rst index ec750131..23ced82f 100644 --- a/docs/api/pyaml.common.abstract.rst +++ b/docs/api/pyaml.common.abstract.rst @@ -3,14 +3,13 @@ pyaml.common.abstract .. automodule:: pyaml.common.abstract - + .. rubric:: Classes .. autosummary:: - + RWMapper ReadFloatArray ReadFloatScalar ReadWriteFloatArray ReadWriteFloatScalar - \ No newline at end of file diff --git a/docs/api/pyaml.common.abstract_aggregator.rst b/docs/api/pyaml.common.abstract_aggregator.rst index 68890543..66203901 100644 --- a/docs/api/pyaml.common.abstract_aggregator.rst +++ b/docs/api/pyaml.common.abstract_aggregator.rst @@ -3,10 +3,9 @@ pyaml.common.abstract\_aggregator .. automodule:: pyaml.common.abstract_aggregator - + .. rubric:: Classes .. autosummary:: - + ScalarAggregator - \ No newline at end of file diff --git a/docs/api/pyaml.common.constants.rst b/docs/api/pyaml.common.constants.rst index 426a6ed0..a3ac42de 100644 --- a/docs/api/pyaml.common.constants.rst +++ b/docs/api/pyaml.common.constants.rst @@ -2,5 +2,3 @@ pyaml.common.constants ====================== .. automodule:: pyaml.common.constants - - \ No newline at end of file diff --git a/docs/api/pyaml.common.element.rst b/docs/api/pyaml.common.element.rst index 37259b5a..5966df4b 100644 --- a/docs/api/pyaml.common.element.rst +++ b/docs/api/pyaml.common.element.rst @@ -3,11 +3,10 @@ pyaml.common.element .. automodule:: pyaml.common.element - + .. rubric:: Classes .. autosummary:: - + Element ElementConfigModel - \ No newline at end of file diff --git a/docs/api/pyaml.common.element_holder.rst b/docs/api/pyaml.common.element_holder.rst index 2927798d..f5c01fbd 100644 --- a/docs/api/pyaml.common.element_holder.rst +++ b/docs/api/pyaml.common.element_holder.rst @@ -3,10 +3,9 @@ pyaml.common.element\_holder .. automodule:: pyaml.common.element_holder - + .. rubric:: Classes .. autosummary:: - + ElementHolder - \ No newline at end of file diff --git a/docs/api/pyaml.common.exception.rst b/docs/api/pyaml.common.exception.rst index de49e273..b21c3f4d 100644 --- a/docs/api/pyaml.common.exception.rst +++ b/docs/api/pyaml.common.exception.rst @@ -3,11 +3,10 @@ pyaml.common.exception .. automodule:: pyaml.common.exception - + .. rubric:: Exceptions .. autosummary:: - + PyAMLConfigException PyAMLException - \ No newline at end of file diff --git a/docs/api/pyaml.common.rst b/docs/api/pyaml.common.rst index 457d7d98..bc3c389d 100644 --- a/docs/api/pyaml.common.rst +++ b/docs/api/pyaml.common.rst @@ -3,7 +3,7 @@ .. automodule:: pyaml.common - + .. rubric:: Modules .. autosummary:: diff --git a/docs/api/pyaml.configuration.csvcurve.rst b/docs/api/pyaml.configuration.csvcurve.rst index 334447d8..9e3a54fa 100644 --- a/docs/api/pyaml.configuration.csvcurve.rst +++ b/docs/api/pyaml.configuration.csvcurve.rst @@ -3,11 +3,10 @@ pyaml.configuration.csvcurve .. automodule:: pyaml.configuration.csvcurve - + .. rubric:: Classes .. autosummary:: - + CSVCurve ConfigModel - \ No newline at end of file diff --git a/docs/api/pyaml.configuration.csvmatrix.rst b/docs/api/pyaml.configuration.csvmatrix.rst index 00090ea3..2fc4e8ff 100644 --- a/docs/api/pyaml.configuration.csvmatrix.rst +++ b/docs/api/pyaml.configuration.csvmatrix.rst @@ -3,11 +3,10 @@ pyaml.configuration.csvmatrix .. automodule:: pyaml.configuration.csvmatrix - + .. rubric:: Classes .. autosummary:: - + CSVMatrix ConfigModel - \ No newline at end of file diff --git a/docs/api/pyaml.configuration.curve.rst b/docs/api/pyaml.configuration.curve.rst index 450ff89f..5880c605 100644 --- a/docs/api/pyaml.configuration.curve.rst +++ b/docs/api/pyaml.configuration.curve.rst @@ -3,10 +3,9 @@ pyaml.configuration.curve .. automodule:: pyaml.configuration.curve - + .. rubric:: Classes .. autosummary:: - + Curve - \ No newline at end of file diff --git a/docs/api/pyaml.configuration.factory.rst b/docs/api/pyaml.configuration.factory.rst index 2ba9d881..ccefc19b 100644 --- a/docs/api/pyaml.configuration.factory.rst +++ b/docs/api/pyaml.configuration.factory.rst @@ -3,11 +3,10 @@ pyaml.configuration.factory .. automodule:: pyaml.configuration.factory - + .. rubric:: Classes .. autosummary:: - + BuildStrategy PyAMLFactory - \ No newline at end of file diff --git a/docs/api/pyaml.configuration.inline_curve.rst b/docs/api/pyaml.configuration.inline_curve.rst index 1a08c5a5..94e8f68e 100644 --- a/docs/api/pyaml.configuration.inline_curve.rst +++ b/docs/api/pyaml.configuration.inline_curve.rst @@ -3,11 +3,10 @@ pyaml.configuration.inline\_curve .. automodule:: pyaml.configuration.inline_curve - + .. rubric:: Classes .. autosummary:: - + ConfigModel InlineCurve - \ No newline at end of file diff --git a/docs/api/pyaml.configuration.inline_matrix.rst b/docs/api/pyaml.configuration.inline_matrix.rst index b194435e..a3f01ea6 100644 --- a/docs/api/pyaml.configuration.inline_matrix.rst +++ b/docs/api/pyaml.configuration.inline_matrix.rst @@ -3,11 +3,10 @@ pyaml.configuration.inline\_matrix .. automodule:: pyaml.configuration.inline_matrix - + .. rubric:: Classes .. autosummary:: - + ConfigModel InlineMatrix - \ No newline at end of file diff --git a/docs/api/pyaml.configuration.matrix.rst b/docs/api/pyaml.configuration.matrix.rst index 4b2432a4..93164ad8 100644 --- a/docs/api/pyaml.configuration.matrix.rst +++ b/docs/api/pyaml.configuration.matrix.rst @@ -3,10 +3,9 @@ pyaml.configuration.matrix .. automodule:: pyaml.configuration.matrix - + .. rubric:: Classes .. autosummary:: - + Matrix - \ No newline at end of file diff --git a/docs/api/pyaml.control.controlsystem.rst b/docs/api/pyaml.control.controlsystem.rst index fc9b7fc2..eaf652ff 100644 --- a/docs/api/pyaml.control.controlsystem.rst +++ b/docs/api/pyaml.control.controlsystem.rst @@ -3,10 +3,9 @@ pyaml.control.controlsystem .. automodule:: pyaml.control.controlsystem - + .. rubric:: Classes .. autosummary:: - + ControlSystem - \ No newline at end of file diff --git a/docs/api/pyaml.control.deviceaccess.rst b/docs/api/pyaml.control.deviceaccess.rst index fdf24b1b..0f55cf7a 100644 --- a/docs/api/pyaml.control.deviceaccess.rst +++ b/docs/api/pyaml.control.deviceaccess.rst @@ -3,10 +3,9 @@ pyaml.control.deviceaccess .. automodule:: pyaml.control.deviceaccess - + .. rubric:: Classes .. autosummary:: - + DeviceAccess - \ No newline at end of file diff --git a/docs/api/pyaml.control.deviceaccesslist.rst b/docs/api/pyaml.control.deviceaccesslist.rst index c7da865a..317a7911 100644 --- a/docs/api/pyaml.control.deviceaccesslist.rst +++ b/docs/api/pyaml.control.deviceaccesslist.rst @@ -3,10 +3,9 @@ pyaml.control.deviceaccesslist .. automodule:: pyaml.control.deviceaccesslist - + .. rubric:: Classes .. autosummary:: - + DeviceAccessList - \ No newline at end of file diff --git a/docs/api/pyaml.control.readback_value.rst b/docs/api/pyaml.control.readback_value.rst index 8945734c..a68bf178 100644 --- a/docs/api/pyaml.control.readback_value.rst +++ b/docs/api/pyaml.control.readback_value.rst @@ -3,11 +3,10 @@ pyaml.control.readback\_value .. automodule:: pyaml.control.readback_value - + .. rubric:: Classes .. autosummary:: - + Quality Value - \ No newline at end of file diff --git a/docs/api/pyaml.control.rst b/docs/api/pyaml.control.rst index 4a68ba70..fd0c42be 100644 --- a/docs/api/pyaml.control.rst +++ b/docs/api/pyaml.control.rst @@ -3,7 +3,7 @@ .. automodule:: pyaml.control - + .. rubric:: Modules .. autosummary:: diff --git a/docs/api/pyaml.diagnostics.tune_monitor.rst b/docs/api/pyaml.diagnostics.tune_monitor.rst index ba5c08ab..6cf280b6 100644 --- a/docs/api/pyaml.diagnostics.tune_monitor.rst +++ b/docs/api/pyaml.diagnostics.tune_monitor.rst @@ -3,11 +3,10 @@ pyaml.diagnostics.tune\_monitor .. automodule:: pyaml.diagnostics.tune_monitor - + .. rubric:: Classes .. autosummary:: - + BetatronTuneMonitor ConfigModel - \ No newline at end of file diff --git a/docs/api/pyaml.external.pySC_interface.rst b/docs/api/pyaml.external.pySC_interface.rst index be4fbf65..71fa2f4a 100644 --- a/docs/api/pyaml.external.pySC_interface.rst +++ b/docs/api/pyaml.external.pySC_interface.rst @@ -3,10 +3,9 @@ pyaml.external.pySC\_interface .. automodule:: pyaml.external.pySC_interface - + .. rubric:: Classes .. autosummary:: - + pySCInterface - \ No newline at end of file diff --git a/docs/api/pyaml.external.rst b/docs/api/pyaml.external.rst index 750bd162..b1f613d1 100644 --- a/docs/api/pyaml.external.rst +++ b/docs/api/pyaml.external.rst @@ -3,7 +3,7 @@ .. automodule:: pyaml.external - + .. rubric:: Modules .. autosummary:: diff --git a/docs/api/pyaml.lattice.attribute_linker.rst b/docs/api/pyaml.lattice.attribute_linker.rst index b4aff637..d6ef8226 100644 --- a/docs/api/pyaml.lattice.attribute_linker.rst +++ b/docs/api/pyaml.lattice.attribute_linker.rst @@ -3,12 +3,11 @@ pyaml.lattice.attribute\_linker .. automodule:: pyaml.lattice.attribute_linker - + .. rubric:: Classes .. autosummary:: - + ConfigModel PyAtAttributeElementsLinker PyAtAttributeIdentifier - \ No newline at end of file diff --git a/docs/api/pyaml.lattice.element.rst b/docs/api/pyaml.lattice.element.rst index 9e1f16f3..2e39f371 100644 --- a/docs/api/pyaml.lattice.element.rst +++ b/docs/api/pyaml.lattice.element.rst @@ -2,5 +2,3 @@ pyaml.lattice.element ===================== .. automodule:: pyaml.lattice.element - - \ No newline at end of file diff --git a/docs/api/pyaml.lattice.lattice_elements_linker.rst b/docs/api/pyaml.lattice.lattice_elements_linker.rst index 186dd7b5..df03d99c 100644 --- a/docs/api/pyaml.lattice.lattice_elements_linker.rst +++ b/docs/api/pyaml.lattice.lattice_elements_linker.rst @@ -3,12 +3,11 @@ pyaml.lattice.lattice\_elements\_linker .. automodule:: pyaml.lattice.lattice_elements_linker - + .. rubric:: Classes .. autosummary:: - + LatticeElementsLinker LinkerConfigModel LinkerIdentifier - \ No newline at end of file diff --git a/docs/api/pyaml.lattice.polynom_info.rst b/docs/api/pyaml.lattice.polynom_info.rst index 7428f476..c5b3d4d8 100644 --- a/docs/api/pyaml.lattice.polynom_info.rst +++ b/docs/api/pyaml.lattice.polynom_info.rst @@ -3,10 +3,9 @@ pyaml.lattice.polynom\_info .. automodule:: pyaml.lattice.polynom_info - + .. rubric:: Classes .. autosummary:: - + PolynomInfo - \ No newline at end of file diff --git a/docs/api/pyaml.lattice.rst b/docs/api/pyaml.lattice.rst index 0e39a286..55a22a6c 100644 --- a/docs/api/pyaml.lattice.rst +++ b/docs/api/pyaml.lattice.rst @@ -3,7 +3,7 @@ .. automodule:: pyaml.lattice - + .. rubric:: Modules .. autosummary:: diff --git a/docs/api/pyaml.lattice.simulator.rst b/docs/api/pyaml.lattice.simulator.rst index 404c3475..8f5b5d40 100644 --- a/docs/api/pyaml.lattice.simulator.rst +++ b/docs/api/pyaml.lattice.simulator.rst @@ -3,11 +3,10 @@ pyaml.lattice.simulator .. automodule:: pyaml.lattice.simulator - + .. rubric:: Classes .. autosummary:: - + ConfigModel Simulator - \ No newline at end of file diff --git a/docs/api/pyaml.magnet.cfm_magnet.rst b/docs/api/pyaml.magnet.cfm_magnet.rst index 3586ebf3..ca04bdbd 100644 --- a/docs/api/pyaml.magnet.cfm_magnet.rst +++ b/docs/api/pyaml.magnet.cfm_magnet.rst @@ -3,11 +3,10 @@ pyaml.magnet.cfm\_magnet .. automodule:: pyaml.magnet.cfm_magnet - + .. rubric:: Classes .. autosummary:: - + CombinedFunctionMagnet ConfigModel - \ No newline at end of file diff --git a/docs/api/pyaml.magnet.corrector.rst b/docs/api/pyaml.magnet.corrector.rst index a6896b50..7e628ef1 100644 --- a/docs/api/pyaml.magnet.corrector.rst +++ b/docs/api/pyaml.magnet.corrector.rst @@ -3,10 +3,9 @@ pyaml.magnet.corrector .. automodule:: pyaml.magnet.corrector - + .. rubric:: Classes .. autosummary:: - + RWCorrectorAngle - \ No newline at end of file diff --git a/docs/api/pyaml.magnet.function_mapping.rst b/docs/api/pyaml.magnet.function_mapping.rst index 3f65513b..0a6a11c8 100644 --- a/docs/api/pyaml.magnet.function_mapping.rst +++ b/docs/api/pyaml.magnet.function_mapping.rst @@ -2,5 +2,3 @@ pyaml.magnet.function\_mapping ============================== .. automodule:: pyaml.magnet.function_mapping - - \ No newline at end of file diff --git a/docs/api/pyaml.magnet.hcorrector.rst b/docs/api/pyaml.magnet.hcorrector.rst index 9f7e08c0..bcf7a7e2 100644 --- a/docs/api/pyaml.magnet.hcorrector.rst +++ b/docs/api/pyaml.magnet.hcorrector.rst @@ -3,11 +3,10 @@ pyaml.magnet.hcorrector .. automodule:: pyaml.magnet.hcorrector - + .. rubric:: Classes .. autosummary:: - + ConfigModel HCorrector - \ No newline at end of file diff --git a/docs/api/pyaml.magnet.identity_cfm_model.rst b/docs/api/pyaml.magnet.identity_cfm_model.rst index 1e704b9d..3f67f243 100644 --- a/docs/api/pyaml.magnet.identity_cfm_model.rst +++ b/docs/api/pyaml.magnet.identity_cfm_model.rst @@ -3,11 +3,10 @@ pyaml.magnet.identity\_cfm\_model .. automodule:: pyaml.magnet.identity_cfm_model - + .. rubric:: Classes .. autosummary:: - + ConfigModel IdentityCFMagnetModel - \ No newline at end of file diff --git a/docs/api/pyaml.magnet.identity_model.rst b/docs/api/pyaml.magnet.identity_model.rst index 7d8c5a9b..4c926459 100644 --- a/docs/api/pyaml.magnet.identity_model.rst +++ b/docs/api/pyaml.magnet.identity_model.rst @@ -3,11 +3,10 @@ pyaml.magnet.identity\_model .. automodule:: pyaml.magnet.identity_model - + .. rubric:: Classes .. autosummary:: - + ConfigModel IdentityMagnetModel - \ No newline at end of file diff --git a/docs/api/pyaml.magnet.linear_cfm_model.rst b/docs/api/pyaml.magnet.linear_cfm_model.rst index f59485f8..05b1cfbc 100644 --- a/docs/api/pyaml.magnet.linear_cfm_model.rst +++ b/docs/api/pyaml.magnet.linear_cfm_model.rst @@ -3,11 +3,10 @@ pyaml.magnet.linear\_cfm\_model .. automodule:: pyaml.magnet.linear_cfm_model - + .. rubric:: Classes .. autosummary:: - + ConfigModel LinearCFMagnetModel - \ No newline at end of file diff --git a/docs/api/pyaml.magnet.linear_model.rst b/docs/api/pyaml.magnet.linear_model.rst index 810d497d..778a3c19 100644 --- a/docs/api/pyaml.magnet.linear_model.rst +++ b/docs/api/pyaml.magnet.linear_model.rst @@ -3,11 +3,10 @@ pyaml.magnet.linear\_model .. automodule:: pyaml.magnet.linear_model - + .. rubric:: Classes .. autosummary:: - + ConfigModel LinearMagnetModel - \ No newline at end of file diff --git a/docs/api/pyaml.magnet.linear_serialized_model.rst b/docs/api/pyaml.magnet.linear_serialized_model.rst index 60104d7a..04caa569 100644 --- a/docs/api/pyaml.magnet.linear_serialized_model.rst +++ b/docs/api/pyaml.magnet.linear_serialized_model.rst @@ -3,11 +3,10 @@ pyaml.magnet.linear\_serialized\_model .. automodule:: pyaml.magnet.linear_serialized_model - + .. rubric:: Classes .. autosummary:: - + ConfigModel LinearSerializedMagnetModel - \ No newline at end of file diff --git a/docs/api/pyaml.magnet.magnet.rst b/docs/api/pyaml.magnet.magnet.rst index 64c24310..b4cbe76c 100644 --- a/docs/api/pyaml.magnet.magnet.rst +++ b/docs/api/pyaml.magnet.magnet.rst @@ -3,11 +3,10 @@ pyaml.magnet.magnet .. automodule:: pyaml.magnet.magnet - + .. rubric:: Classes .. autosummary:: - + Magnet MagnetConfigModel - \ No newline at end of file diff --git a/docs/api/pyaml.magnet.model.rst b/docs/api/pyaml.magnet.model.rst index cb2a4f1a..8f26a4fc 100644 --- a/docs/api/pyaml.magnet.model.rst +++ b/docs/api/pyaml.magnet.model.rst @@ -3,10 +3,9 @@ pyaml.magnet.model .. automodule:: pyaml.magnet.model - + .. rubric:: Classes .. autosummary:: - + MagnetModel - \ No newline at end of file diff --git a/docs/api/pyaml.magnet.octupole.rst b/docs/api/pyaml.magnet.octupole.rst index 4e604f7c..2a12c2db 100644 --- a/docs/api/pyaml.magnet.octupole.rst +++ b/docs/api/pyaml.magnet.octupole.rst @@ -3,11 +3,10 @@ pyaml.magnet.octupole .. automodule:: pyaml.magnet.octupole - + .. rubric:: Classes .. autosummary:: - + ConfigModel Octupole - \ No newline at end of file diff --git a/docs/api/pyaml.magnet.quadrupole.rst b/docs/api/pyaml.magnet.quadrupole.rst index b2271122..6b7f8274 100644 --- a/docs/api/pyaml.magnet.quadrupole.rst +++ b/docs/api/pyaml.magnet.quadrupole.rst @@ -3,11 +3,10 @@ pyaml.magnet.quadrupole .. automodule:: pyaml.magnet.quadrupole - + .. rubric:: Classes .. autosummary:: - + ConfigModel Quadrupole - \ No newline at end of file diff --git a/docs/api/pyaml.magnet.rst b/docs/api/pyaml.magnet.rst index dc0874ae..615f17d9 100644 --- a/docs/api/pyaml.magnet.rst +++ b/docs/api/pyaml.magnet.rst @@ -3,7 +3,7 @@ .. automodule:: pyaml.magnet - + .. rubric:: Modules .. autosummary:: diff --git a/docs/api/pyaml.magnet.serialized_magnet.rst b/docs/api/pyaml.magnet.serialized_magnet.rst index 29acf385..462729cf 100644 --- a/docs/api/pyaml.magnet.serialized_magnet.rst +++ b/docs/api/pyaml.magnet.serialized_magnet.rst @@ -3,13 +3,12 @@ pyaml.magnet.serialized\_magnet .. automodule:: pyaml.magnet.serialized_magnet - + .. rubric:: Classes .. autosummary:: - + ConfigModel ReadWriteSerializedHardwares ReadWriteSerializedStrengths SerializedMagnets - \ No newline at end of file diff --git a/docs/api/pyaml.magnet.sextupole.rst b/docs/api/pyaml.magnet.sextupole.rst index fa20c2f1..41036f36 100644 --- a/docs/api/pyaml.magnet.sextupole.rst +++ b/docs/api/pyaml.magnet.sextupole.rst @@ -3,11 +3,10 @@ pyaml.magnet.sextupole .. automodule:: pyaml.magnet.sextupole - + .. rubric:: Classes .. autosummary:: - + ConfigModel Sextupole - \ No newline at end of file diff --git a/docs/api/pyaml.magnet.skewoctu.rst b/docs/api/pyaml.magnet.skewoctu.rst index a1970d6d..52738911 100644 --- a/docs/api/pyaml.magnet.skewoctu.rst +++ b/docs/api/pyaml.magnet.skewoctu.rst @@ -3,11 +3,10 @@ pyaml.magnet.skewoctu .. automodule:: pyaml.magnet.skewoctu - + .. rubric:: Classes .. autosummary:: - + ConfigModel SkewOctu - \ No newline at end of file diff --git a/docs/api/pyaml.magnet.skewquad.rst b/docs/api/pyaml.magnet.skewquad.rst index da805406..f7c303bd 100644 --- a/docs/api/pyaml.magnet.skewquad.rst +++ b/docs/api/pyaml.magnet.skewquad.rst @@ -3,11 +3,10 @@ pyaml.magnet.skewquad .. automodule:: pyaml.magnet.skewquad - + .. rubric:: Classes .. autosummary:: - + ConfigModel SkewQuad - \ No newline at end of file diff --git a/docs/api/pyaml.magnet.skewsext.rst b/docs/api/pyaml.magnet.skewsext.rst index a5a8d734..ad25ced8 100644 --- a/docs/api/pyaml.magnet.skewsext.rst +++ b/docs/api/pyaml.magnet.skewsext.rst @@ -3,11 +3,10 @@ pyaml.magnet.skewsext .. automodule:: pyaml.magnet.skewsext - + .. rubric:: Classes .. autosummary:: - + ConfigModel SkewSext - \ No newline at end of file diff --git a/docs/api/pyaml.magnet.spline_model.rst b/docs/api/pyaml.magnet.spline_model.rst index bcc135c3..10d9a277 100644 --- a/docs/api/pyaml.magnet.spline_model.rst +++ b/docs/api/pyaml.magnet.spline_model.rst @@ -3,11 +3,10 @@ pyaml.magnet.spline\_model .. automodule:: pyaml.magnet.spline_model - + .. rubric:: Classes .. autosummary:: - + ConfigModel SplineMagnetModel - \ No newline at end of file diff --git a/docs/api/pyaml.magnet.vcorrector.rst b/docs/api/pyaml.magnet.vcorrector.rst index 8aae6151..4a14c897 100644 --- a/docs/api/pyaml.magnet.vcorrector.rst +++ b/docs/api/pyaml.magnet.vcorrector.rst @@ -3,11 +3,10 @@ pyaml.magnet.vcorrector .. automodule:: pyaml.magnet.vcorrector - + .. rubric:: Classes .. autosummary:: - + ConfigModel VCorrector - \ No newline at end of file diff --git a/docs/api/pyaml.rf.rf_plant.rst b/docs/api/pyaml.rf.rf_plant.rst index 783bfb51..62e155b6 100644 --- a/docs/api/pyaml.rf.rf_plant.rst +++ b/docs/api/pyaml.rf.rf_plant.rst @@ -3,12 +3,11 @@ pyaml.rf.rf\_plant .. automodule:: pyaml.rf.rf_plant - + .. rubric:: Classes .. autosummary:: - + ConfigModel RFPlant RWTotalVoltage - \ No newline at end of file diff --git a/docs/api/pyaml.rf.rf_transmitter.rst b/docs/api/pyaml.rf.rf_transmitter.rst index 63939a14..36f1893a 100644 --- a/docs/api/pyaml.rf.rf_transmitter.rst +++ b/docs/api/pyaml.rf.rf_transmitter.rst @@ -3,11 +3,10 @@ pyaml.rf.rf\_transmitter .. automodule:: pyaml.rf.rf_transmitter - + .. rubric:: Classes .. autosummary:: - + ConfigModel RFTransmitter - \ No newline at end of file diff --git a/docs/api/pyaml.rf.rst b/docs/api/pyaml.rf.rst index c71572f6..e1c74825 100644 --- a/docs/api/pyaml.rf.rst +++ b/docs/api/pyaml.rf.rst @@ -3,7 +3,7 @@ .. automodule:: pyaml.rf - + .. rubric:: Modules .. autosummary:: diff --git a/docs/api/pyaml.tuning_tools.rst b/docs/api/pyaml.tuning_tools.rst index 600cd1ed..03d45e2a 100644 --- a/docs/api/pyaml.tuning_tools.rst +++ b/docs/api/pyaml.tuning_tools.rst @@ -2,5 +2,3 @@ =================== .. automodule:: pyaml.tuning_tools - - \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py index dd15d6f6..b8017d79 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,4 +1,3 @@ - # Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full @@ -40,14 +39,14 @@ root_doc = "index" extensions = [ - "sphinx.ext.autosummary", # Automatically generates summary tables and stub pages for documented functions, classes, and modules - "sphinx.ext.napoleon", # Adds support for NumPy-style and Google-style docstrings, so you don’t have to write reStructuredText by hand. - "sphinx.ext.intersphinx", # Allows you to link to documentation of other projects (e.g. NumPy, Python, SciPy) as if they were local. - "sphinx.ext.githubpages", # Adds support files (like .nojekyll) needed to publish docs on GitHub Pages. - "sphinx.ext.viewcode", # Adds links in the docs to view the source code of documented Python objects. - "myst_nb", # Enables MyST Markdown and Jupyter Notebook support. - "sphinx_copybutton", # Adds a “copy to clipboard” button to code blocks. - "sphinx_design", # Provides layout and design components (cards, grids, tabs, buttons). + "sphinx.ext.autosummary", # Automatically generates summary tables and stub pages for documented functions, classes, and modules + "sphinx.ext.napoleon", # Adds support for NumPy-style and Google-style docstrings, so you don’t have to write reStructuredText by hand. + "sphinx.ext.intersphinx", # Allows you to link to documentation of other projects (e.g. NumPy, Python, SciPy) as if they were local. + "sphinx.ext.githubpages", # Adds support files (like .nojekyll) needed to publish docs on GitHub Pages. + "sphinx.ext.viewcode", # Adds links in the docs to view the source code of documented Python objects. + "myst_nb", # Enables MyST Markdown and Jupyter Notebook support. + "sphinx_copybutton", # Adds a “copy to clipboard” button to code blocks. + "sphinx_design", # Provides layout and design components (cards, grids, tabs, buttons). ] intersphinx_mapping = { @@ -120,9 +119,9 @@ html_theme_options = { "github_url": "https://github.com/python-accelerator-middle-layer/pyaml", "logo": { - "image_light": "_static/img/logo.png", - "image_dark": "_static/img/dark.png", - } + "image_light": "_static/img/logo.png", + "image_dark": "_static/img/dark.png", + }, } html_sidebars = { "index": [], @@ -202,7 +201,6 @@ # master_doc = "index" - # # The language for content autogenerated by Sphinx. Refer to documentation # # for a list of supported languages. # # diff --git a/docs/getting-started/configuration.md b/docs/getting-started/configuration.md index 3872e12d..9df0aa9c 100644 --- a/docs/getting-started/configuration.md +++ b/docs/getting-started/configuration.md @@ -1,4 +1,4 @@ Setting up the Configuration ====== -To write... \ No newline at end of file +To write... diff --git a/docs/getting-started/index.rst b/docs/getting-started/index.rst index 3c0aee46..4be6fe1d 100644 --- a/docs/getting-started/index.rst +++ b/docs/getting-started/index.rst @@ -1,7 +1,7 @@ Getting Started ====== -If you are a new user or developer you find instructions here for how to get started. +If you are a new user or developer you find instructions here for how to get started. .. toctree:: :maxdepth: 1 diff --git a/docs/getting-started/installation.md b/docs/getting-started/installation.md index 46ef49c3..caf72055 100644 --- a/docs/getting-started/installation.md +++ b/docs/getting-started/installation.md @@ -30,7 +30,7 @@ Available options for installing with control system bindings are: Example usage: ``` -pip install accelerator-middle-layer[cs-oa-epics] +pip install accelerator-middle-layer[cs-oa-epics] ``` ## Developer Installation @@ -67,7 +67,7 @@ To do development work you need to clone the source code from GitHub and install 5. Install control system bindings *(optional)* If you want to use control system bindings you need to also install the package for the binding you want to use. Follow the installation instructions in the corresponding repository. - + If you want to do development work on the bindings they need to be installed in editable mode, but if not you can install the latest release from PyPI. 6. Install dummy control system for TANGO *(optional)* diff --git a/docs/getting-started/python-basics.md b/docs/getting-started/python-basics.md index 13f38747..23dd71a0 100644 --- a/docs/getting-started/python-basics.md +++ b/docs/getting-started/python-basics.md @@ -11,10 +11,10 @@ Integrated Development Environments Python can be run directly in a terminal or an [IPython](https://ipython.org/) shell but if you want to do more complex things like debug or develop code it is easier to use an Integrated Development Environment (IDE). There are many IDEs with Python support with different features, user experience etc so the choice is highly personal. Three common ones are: - **Spyder**: - [https://www.spyder-ide.org/](https://www.spyder-ide.org/) + [https://www.spyder-ide.org/](https://www.spyder-ide.org/) Spyder is designed for scientific computing and data analysis. It has the most MATLAB-like interface which often makes it a preferred choice among MATLAB users. It works well when using standard scientific Python packages but has currently less support for custom Python classes. It also only has basic Git integration and works best with conda environments. There is an plugin for Jupyter notebooks but it is not available for all the installation options yet. - + - **VS Code**: [https://code.visualstudio.com/](https://code.visualstudio.com/) @@ -51,9 +51,9 @@ There are many different ways to get an installation of Python. An important asp [https://docs.astral.sh/uv/](https://docs.astral.sh/uv/) Uv is a new tool which is intended as a single tool to replace the functionality of many other tools. In addition to managing Python versions and virtual environments it can also help to build packages. It however has a bit of a learning curve so is likely mostly a good choice for the experienced user who also wants to do development work. - + Python Packages ------------------ +----------------- After you have installed Python you need to install packages for the code that you want to use. There are two common ways to do this: diff --git a/docs/index.rst b/docs/index.rst index d780b501..083423b5 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -10,7 +10,7 @@ The code is still under development. The features include among others: - Machine independence allowing configuration of different type of accelerators and facility specific naming conventions. - Unit conversions. - Automatic generation of metadata and standardized format for measurement data. -- A set of standard applications and a framework for developing new applications. +- A set of standard applications and a framework for developing new applications. Installation ------------ diff --git a/pyaml/accelerator.py b/pyaml/accelerator.py index 73f3d39b..cd13eafb 100644 --- a/pyaml/accelerator.py +++ b/pyaml/accelerator.py @@ -97,6 +97,14 @@ def __init__(self, cfg: ConfigModel): self.post_init() def set_energy(self, E: float): + """ + Set the energy for all simulators and control systems. + + Parameters + ---------- + E : float + Energy value to set in GeV + """ if self._cfg.simulators is not None: for s in self._cfg.simulators: s.set_energy(E) @@ -117,10 +125,26 @@ def post_init(self): @property def live(self) -> ControlSystem: + """ + Get the live control system. + + Returns + ------- + ControlSystem + The live control system instance + """ return self.__live @property def design(self) -> Simulator: + """ + Get the design simulator. + + Returns + ------- + Simulator + The design simulator instance + """ return self.__design @staticmethod diff --git a/pyaml/arrays/array.py b/pyaml/arrays/array.py index c464a9ba..59cdd44f 100644 --- a/pyaml/arrays/array.py +++ b/pyaml/arrays/array.py @@ -36,4 +36,17 @@ def __init__(self, cfg: ArrayConfigModel): self._cfg = cfg def fill_array(self, holder: ElementHolder): + """ + Fill array with elements from the holder. + + Parameters + ---------- + holder : ElementHolder + The element holder to populate + + Raises + ------ + PyAMLException + When this method is not overridden in a subclass + """ raise PyAMLException("Array.fill_array() is not subclassed") diff --git a/pyaml/arrays/bpm.py b/pyaml/arrays/bpm.py index 1b08ffb5..cb2e3f72 100644 --- a/pyaml/arrays/bpm.py +++ b/pyaml/arrays/bpm.py @@ -5,7 +5,10 @@ PYAMLCLASS = "BPM" -class ConfigModel(ArrayConfigModel): ... +class ConfigModel(ArrayConfigModel): + """Configuration model for BPM array.""" + + ... class BPM(ArrayConfig): @@ -27,4 +30,12 @@ def __init__(self, cfg: ArrayConfigModel): super().__init__(cfg) def fill_array(self, holder: ElementHolder): + """ + Fill the BPM array in the element holder. + + Parameters + ---------- + holder : ElementHolder + The element holder to populate with BPM array + """ holder.fill_bpm_array(self._cfg.name, self._cfg.elements) diff --git a/pyaml/arrays/bpm_array.py b/pyaml/arrays/bpm_array.py index ebb8b049..36d50a3c 100644 --- a/pyaml/arrays/bpm_array.py +++ b/pyaml/arrays/bpm_array.py @@ -7,6 +7,21 @@ class RWBPMPosition(ReadFloatArray): + """ + Read/write access to BPM positions (horizontal and vertical). + + This class provides access to both horizontal and vertical positions + of a list of BPMs. It supports both individual access and aggregated + access through a device access list for improved performance. + + Parameters + ---------- + name : str + Name of the position accessor + bpms : list[BPM] + List of BPM objects to access + """ + def __init__(self, name: str, bpms: list[BPM]): self.__bpms = bpms self.__name = name @@ -14,6 +29,15 @@ def __init__(self, name: str, bpms: list[BPM]): # Gets the values def get(self) -> np.array: + """ + Get BPM positions. + + Returns + ------- + np.array + Array of shape (n_bpms, 2) containing horizontal and vertical + positions for each BPM + """ if not self.__aggregator: return np.array([b.positions.get() for b in self.__bpms]) else: @@ -21,14 +45,47 @@ def get(self) -> np.array: # Gets the unit of the values def unit(self) -> list[str]: + """ + Get the units for BPM positions. + + Returns + ------- + list[str] + List of unit strings for each BPM + """ return [b.positions.unit() for b in self.__bpms] # Set the aggregator (Control system only) def set_aggregator(self, agg: DeviceAccessList): + """ + Set the device access list aggregator for improved performance. + + Parameters + ---------- + agg : DeviceAccessList + Device access list for aggregated reads + """ self.__aggregator = agg class RWBPMSinglePosition(ReadFloatArray): + """ + Read/write access to single axis BPM positions. + + This class provides access to either horizontal or vertical positions + of a list of BPMs. It supports both individual access and aggregated + access through a device access list for improved performance. + + Parameters + ---------- + name : str + Name of the position accessor + bpms : list[BPM] + List of BPM objects to access + idx : int + Index for the position axis (0 for horizontal, 1 for vertical) + """ + def __init__(self, name: str, bpms: list[BPM], idx: int): self.__bpms = bpms self.__name = name @@ -37,6 +94,14 @@ def __init__(self, name: str, bpms: list[BPM], idx: int): # Gets the values def get(self) -> np.array: + """ + Get single axis BPM positions. + + Returns + ------- + np.array + Array of positions for the specified axis (horizontal or vertical) + """ if not self.__aggregator: return np.array([b.positions.get()[self.__idx] for b in self.__bpms]) else: @@ -44,10 +109,26 @@ def get(self) -> np.array: # Gets the unit of the values def unit(self) -> list[str]: + """ + Get the units for BPM positions. + + Returns + ------- + list[str] + List of unit strings for each BPM + """ return [b.positions.unit() for b in self.__bpms] # Set the aggregator (Control system only) def set_aggregator(self, agg: DeviceAccessList): + """ + Set the device access list aggregator for improved performance. + + Parameters + ---------- + agg : DeviceAccessList + Device access list for aggregated reads + """ self.__aggregator = agg diff --git a/pyaml/arrays/cfm_magnet.py b/pyaml/arrays/cfm_magnet.py index 1d73a278..f69ce658 100644 --- a/pyaml/arrays/cfm_magnet.py +++ b/pyaml/arrays/cfm_magnet.py @@ -5,7 +5,10 @@ PYAMLCLASS = "CombinedFunctionMagnet" -class ConfigModel(ArrayConfigModel): ... +class ConfigModel(ArrayConfigModel): + """Configuration model for Combined Function Magnet array.""" + + ... class CombinedFunctionMagnet(ArrayConfig): @@ -29,4 +32,12 @@ def __init__(self, cfg: ArrayConfigModel): super().__init__(cfg) def fill_array(self, holder: ElementHolder): + """ + Fill the combined function magnet array in the element holder. + + Parameters + ---------- + holder : ElementHolder + The element holder to populate with combined function magnet array + """ holder.fill_cfm_magnet_array(self._cfg.name, self._cfg.elements) diff --git a/pyaml/arrays/element.py b/pyaml/arrays/element.py index 33084115..1dd83adf 100644 --- a/pyaml/arrays/element.py +++ b/pyaml/arrays/element.py @@ -5,7 +5,10 @@ PYAMLCLASS = "Element" -class ConfigModel(ArrayConfigModel): ... +class ConfigModel(ArrayConfigModel): + """Configuration model for Element array.""" + + ... class Element(ArrayConfig): @@ -30,4 +33,12 @@ def __init__(self, cfg: ArrayConfigModel): super().__init__(cfg) def fill_array(self, holder: ElementHolder): + """ + Fill the element array in the element holder. + + Parameters + ---------- + holder : ElementHolder + The element holder to populate with element array + """ holder.fill_element_array(self._cfg.name, self._cfg.elements) diff --git a/pyaml/arrays/magnet.py b/pyaml/arrays/magnet.py index 93e9b606..d65282cd 100644 --- a/pyaml/arrays/magnet.py +++ b/pyaml/arrays/magnet.py @@ -5,7 +5,10 @@ PYAMLCLASS = "Magnet" -class ConfigModel(ArrayConfigModel): ... +class ConfigModel(ArrayConfigModel): + """Configuration model for Magnet array.""" + + ... class Magnet(ArrayConfig): @@ -28,4 +31,12 @@ def __init__(self, cfg: ArrayConfigModel): super().__init__(cfg) def fill_array(self, holder: ElementHolder): + """ + Fill the magnet array in the element holder. + + Parameters + ---------- + holder : ElementHolder + The element holder to populate with magnet array + """ holder.fill_magnet_array(self._cfg.name, self._cfg.elements) diff --git a/pyaml/arrays/serialized_magnet.py b/pyaml/arrays/serialized_magnet.py index b150d6ea..fd412403 100644 --- a/pyaml/arrays/serialized_magnet.py +++ b/pyaml/arrays/serialized_magnet.py @@ -5,7 +5,10 @@ PYAMLCLASS = "SerializedMagnets" -class ConfigModel(ArrayConfigModel): ... +class ConfigModel(ArrayConfigModel): + """Configuration model for Serialized Magnets array.""" + + ... class SerializedMagnets(ArrayConfig): @@ -29,4 +32,12 @@ def __init__(self, cfg: ArrayConfigModel): super().__init__(cfg) def fill_array(self, holder: ElementHolder): + """ + Fill the serialized magnet array in the element holder. + + Parameters + ---------- + holder : ElementHolder + The element holder to populate with serialized magnet array + """ holder.fill_serialized_magnet_array(self._cfg.name, self._cfg.elements) diff --git a/pyaml/bpm/bpm.py b/pyaml/bpm/bpm.py index acc35e75..1a14f4b9 100644 --- a/pyaml/bpm/bpm.py +++ b/pyaml/bpm/bpm.py @@ -12,8 +12,16 @@ class ConfigModel(ElementConfigModel): + """ + Configuration model for BPM element. + + Attributes + ---------- + model : BPMModel or None, optional + Object in charge of BPM modeling + """ + model: BPMModel | None = None - """Object in charge of BPM modeling""" class BPM(Element): @@ -43,22 +51,69 @@ def __init__(self, cfg: ConfigModel): @property def model(self) -> BPMModel: + """ + Get the BPM model. + + Returns + ------- + BPMModel + The BPM model instance + """ return self.__model @property def positions(self) -> RBpmArray: + """ + Get the BPM position readings. + + Returns + ------- + RBpmArray + BPM position array containing horizontal and vertical positions + + Raises + ------ + PyAMLException + If positions have not been attached + """ if self.__positions is None: raise PyAMLException(f"{str(self)} has no attached positions") return self.__positions @property def offset(self) -> RWBpmOffsetArray: + """ + Get the BPM offset values. + + Returns + ------- + RWBpmOffsetArray + BPM offset array for position correction + + Raises + ------ + PyAMLException + If offset has not been attached + """ if self.__offset is None: raise PyAMLException(f"{str(self)} has no attached offset") return self.__offset @property def tilt(self) -> RWBpmTiltScalar: + """ + Get the BPM tilt angle. + + Returns + ------- + RWBpmTiltScalar + BPM tilt angle for rotation correction + + Raises + ------ + PyAMLException + If tilt has not been attached + """ if self.__tilt is None: raise PyAMLException(f"{str(self)} has no attached tilt") return self.__tilt @@ -70,6 +125,25 @@ def attach( offset: RWBpmOffsetArray, tilt: RWBpmTiltScalar, ) -> Self: + """ + Attach BPM attributes to a peer. + + Parameters + ---------- + peer : object + The peer object (simulator or control system) + positions : RBpmArray + BPM position readings + offset : RWBpmOffsetArray + BPM offset values for correction + tilt : RWBpmTiltScalar + BPM tilt angle for rotation correction + + Returns + ------- + Self + A new attached instance of BPM + """ # Attach positions, offset and tilt attributes and returns a new # reference obj = self.__class__(self._cfg) diff --git a/pyaml/bpm/bpm_model.py b/pyaml/bpm/bpm_model.py index 19fd21d3..e00c2aa3 100644 --- a/pyaml/bpm/bpm_model.py +++ b/pyaml/bpm/bpm_model.py @@ -75,6 +75,14 @@ def y_pos_index(self) -> int | None: return None def is_pos_indexed(self) -> bool: + """ + Check if position values are indexed (array-based). + + Returns + ------- + bool + True if both x and y positions are indexed, False otherwise + """ return self.x_pos_index() is not None and self.y_pos_index() is not None def tilt_index(self) -> int | None: @@ -91,6 +99,14 @@ def tilt_index(self) -> int | None: return None def is_tilt_indexed(self) -> bool: + """ + Check if tilt value is indexed (array-based). + + Returns + ------- + bool + True if tilt is indexed, False otherwise + """ return self.tilt_index() is not None def x_offset_index(self) -> int | None: @@ -120,4 +136,12 @@ def y_offset_index(self) -> int | None: return None def is_offset_indexed(self) -> bool: + """ + Check if offset values are indexed (array-based). + + Returns + ------- + bool + True if both x and y offsets are indexed, False otherwise + """ return self.x_offset_index() is not None and self.y_offset_index() is not None diff --git a/pyaml/common/abstract.py b/pyaml/common/abstract.py index 487ba6f9..3eb1989b 100644 --- a/pyaml/common/abstract.py +++ b/pyaml/common/abstract.py @@ -82,22 +82,67 @@ def __init__(self, bind, idx: int): # Gets the value def get(self) -> float: + """ + Get the value at the mapped index. + + Returns + ------- + float + Value at the mapped array index + """ return self.bind.get()[self.idx] # Sets the value def set(self, value: float): + """ + Set the value at the mapped index. + + Parameters + ---------- + value : float + Value to set + """ arr = self.bind.get() arr[self.idx] = value self.bind.set(arr) # Sets the value and wait that the read value reach the setpoint def set_and_wait(self, value: float): + """ + Set the value and wait for it to reach the setpoint. + + Parameters + ---------- + value : float + Target value to set and wait for + + Raises + ------ + NotImplementedError + This method is not yet implemented + """ raise NotImplementedError("Not implemented yet.") # Return the unit def unit(self) -> str: + """ + Get the unit for the value. + + Returns + ------- + str + Unit string for the value at the mapped index + """ return self.bind.unit()[self.idx] # Return the mapped index def index(self) -> int: + """ + Get the mapped array index. + + Returns + ------- + int + The index in the array that this scalar maps to + """ return self.idx diff --git a/pyaml/configuration/csvcurve.py b/pyaml/configuration/csvcurve.py index 5f9fa828..fadb0a45 100644 --- a/pyaml/configuration/csvcurve.py +++ b/pyaml/configuration/csvcurve.py @@ -51,6 +51,14 @@ def __init__(self, cfg: ConfigModel): ) def get_curve(self) -> np.array: + """ + Get the curve data. + + Returns + ------- + np.array + Curve data as a 2D numpy array of shape (n, 2) + """ return self._curve def __repr__(self): diff --git a/pyaml/configuration/csvmatrix.py b/pyaml/configuration/csvmatrix.py index 0d0d955c..daed97f8 100644 --- a/pyaml/configuration/csvmatrix.py +++ b/pyaml/configuration/csvmatrix.py @@ -43,6 +43,14 @@ def __init__(self, cfg: ConfigModel): ) from None def get_matrix(self) -> np.array: + """ + Get the matrix data. + + Returns + ------- + np.array + Matrix data as a numpy array + """ return self._mat def __repr__(self): diff --git a/pyaml/configuration/inline_curve.py b/pyaml/configuration/inline_curve.py index c6397f28..e92071ab 100644 --- a/pyaml/configuration/inline_curve.py +++ b/pyaml/configuration/inline_curve.py @@ -43,6 +43,14 @@ def __init__(self, cfg: ConfigModel): ) def get_curve(self) -> np.array: + """ + Get the curve data. + + Returns + ------- + np.array + Curve data as a 2D numpy array of shape (n, 2) + """ return self._curve def __repr__(self): diff --git a/pyaml/configuration/inline_matrix.py b/pyaml/configuration/inline_matrix.py index fc8ac320..25d03c78 100644 --- a/pyaml/configuration/inline_matrix.py +++ b/pyaml/configuration/inline_matrix.py @@ -33,6 +33,14 @@ def __init__(self, cfg: ConfigModel): self._mat = np.array(self._cfg.mat) def get_matrix(self) -> np.array: + """ + Get the matrix data. + + Returns + ------- + np.array + Matrix data as a numpy array + """ return self._mat def __repr__(self): diff --git a/pyaml/control/deviceaccess.py b/pyaml/control/deviceaccess.py index 258a454c..ec37cd4f 100644 --- a/pyaml/control/deviceaccess.py +++ b/pyaml/control/deviceaccess.py @@ -45,9 +45,24 @@ def unit(self) -> str: @abstractmethod def get_range(self) -> list[float]: + """ + Get the valid range for the device variable. + + Returns + ------- + list[float] + List containing [min, max] values + """ pass @abstractmethod def check_device_availability(self) -> bool: - pass + """ + Check if the device is available and accessible. + Returns + ------- + bool + True if device is available, False otherwise + """ + pass diff --git a/pyaml/control/deviceaccesslist.py b/pyaml/control/deviceaccesslist.py index 65854ae4..e913389e 100644 --- a/pyaml/control/deviceaccesslist.py +++ b/pyaml/control/deviceaccesslist.py @@ -50,8 +50,24 @@ def unit(self) -> str: @abstractmethod def get_range(self) -> list[float]: + """ + Get the valid range for the device variables. + + Returns + ------- + list[float] + List containing [min, max] values + """ pass @abstractmethod def check_device_availability(self) -> bool: + """ + Check if all devices in the list are available and accessible. + + Returns + ------- + bool + True if all devices are available, False otherwise + """ pass diff --git a/pyaml/control/readback_value.py b/pyaml/control/readback_value.py index c0dc08aa..004a8ee9 100644 --- a/pyaml/control/readback_value.py +++ b/pyaml/control/readback_value.py @@ -6,6 +6,23 @@ class Quality(Enum): + """ + Enumeration for data quality indicators. + + Attributes + ---------- + VALID : int + Data is valid and reliable + INVALID : int + Data is invalid + ALARM : int + Data indicates an alarm condition + CHANGING : int + Data is currently changing + WARNING : int + Data indicates a warning condition + """ + VALID = auto() INVALID = auto() ALARM = auto() diff --git a/pyaml/diagnostics/chromaticity_monitor.py b/pyaml/diagnostics/chromaticity_monitor.py index ca36f9db..b4afe74e 100644 --- a/pyaml/diagnostics/chromaticity_monitor.py +++ b/pyaml/diagnostics/chromaticity_monitor.py @@ -19,39 +19,39 @@ class ConfigModel(ElementConfigModel): - model_config = ConfigDict(arbitrary_types_allowed=True, extra="forbid") - """ - Chomaticity measurement + Configuration model for Chromaticity Monitor. Parameters ---------- - betatron_tune: str + betatron_tune : str Name of the diagnostic pyaml device for measuring the tune - RFfreq: str + RFfreq : str Name of main RF frequency plant - N_step: int = 5 + N_step : int, optional Default number of RF step during chromaticity - measurment [default: 5] - alphac: float | None = None - Moment compaction factor - E_delta: float - Default variation of relative energy during chromaticity measurment: - f0 - f0 * E_delta * alphac < f_RF < f0 + f0 * E_delta * alphac - [default: 0.001] - Max_E_delta: float - Maximum autorized variation of relative energy during chromaticity - measurment [default: 0.004] - N_tune_meas: int - Default number of tune measurment per RF frequency [default: 1] - Sleep_between_meas: float - Default time sleep between two tune measurment [default: 2.0] - Sleep_between_RFvar: float - Default time sleep after RF frequency variation [default: 5.0] - fit_order: int - Fitting order [default: 1] + measurement, by default 5 + alphac : float or None, optional + Momentum compaction factor, by default None + E_delta : float, optional + Default variation of relative energy during chromaticity measurement: + f0 - f0 * E_delta * alphac < f_RF < f0 + f0 * E_delta * alphac, + by default 0.001 + Max_E_delta : float, optional + Maximum authorized variation of relative energy during chromaticity + measurement, by default 0.004 + N_tune_meas : int, optional + Default number of tune measurement per RF frequency, by default 1 + Sleep_between_meas : float, optional + Default time sleep between two tune measurements, by default 2.0 + Sleep_between_RFvar : float, optional + Default time sleep after RF frequency variation, by default 5.0 + fit_order : int, optional + Fitting order, by default 1 """ + model_config = ConfigDict(arbitrary_types_allowed=True, extra="forbid") + betatron_tune: str RFfreq: str N_step: int = 5 @@ -90,10 +90,33 @@ def __init__(self, cfg: ConfigModel): @property def chromaticity(self) -> ReadFloatArray: + """ + Get the chromaticity values. + + Returns + ------- + ReadFloatArray + Array of chromaticity values [horizontal, vertical] + """ self.check_peer() return self.__chromaticity def attach(self, peer, chromaticity: ReadFloatArray) -> Self: + """ + Attach the chromaticity monitor to a peer with chromaticity data. + + Parameters + ---------- + peer : object + The peer object (simulator or control system) + chromaticity : ReadFloatArray + The chromaticity array to monitor + + Returns + ------- + Self + A new attached instance of ChromaticityMonitor + """ obj = self.__class__(self._cfg) chromaticity._update_chromaticity_monitor(obj) obj.__chromaticity = chromaticity diff --git a/pyaml/diagnostics/tune_monitor.py b/pyaml/diagnostics/tune_monitor.py index f42d6314..bc2129ec 100644 --- a/pyaml/diagnostics/tune_monitor.py +++ b/pyaml/diagnostics/tune_monitor.py @@ -53,10 +53,33 @@ def __init__(self, cfg: ConfigModel): @property def tune(self) -> ReadFloatArray: + """ + Get the betatron tune values. + + Returns + ------- + ReadFloatArray + Array of tune values [horizontal, vertical] + """ self.check_peer() return self.__tune def attach(self, peer, betatron_tune: ReadFloatArray) -> Self: + """ + Attach the tune monitor to a peer with betatron tune data. + + Parameters + ---------- + peer : object + The peer object (simulator or control system) + betatron_tune : ReadFloatArray + The betatron tune array to monitor + + Returns + ------- + Self + A new attached instance of TuneMonitor + """ obj = self.__class__(self._cfg) obj.__tune = betatron_tune obj._peer = peer diff --git a/pyaml/lattice/abstract_impl.py b/pyaml/lattice/abstract_impl.py index cbd01e87..bbc53be6 100644 --- a/pyaml/lattice/abstract_impl.py +++ b/pyaml/lattice/abstract_impl.py @@ -580,6 +580,7 @@ def get(self) -> float: def unit(self) -> str: return "1" + # ------------------------------------------------------------------------------ diff --git a/pyaml/lattice/attribute_linker.py b/pyaml/lattice/attribute_linker.py index ee541346..820b8c97 100644 --- a/pyaml/lattice/attribute_linker.py +++ b/pyaml/lattice/attribute_linker.py @@ -66,6 +66,19 @@ def __init__(self, config_model: ConfigModel): super().__init__(config_model) def get_element_identifier(self, element: Element) -> LinkerIdentifier: + """ + Get the element identifier for the given element. + + Parameters + ---------- + element : Element + The element to get the identifier for + + Returns + ------- + LinkerIdentifier + The identifier for linking the element + """ return PyAtAttributeIdentifier( self.linker_config_model.attribute_name, element.get_name() ) diff --git a/pyaml/lattice/lattice_elements_linker.py b/pyaml/lattice/lattice_elements_linker.py index 188049a4..68b40da1 100644 --- a/pyaml/lattice/lattice_elements_linker.py +++ b/pyaml/lattice/lattice_elements_linker.py @@ -64,6 +64,14 @@ def __init__(self, linker_config_model: LinkerConfigModel): self.lattice: Lattice = None def set_lattice(self, lattice: Lattice): + """ + Set the lattice for element linking. + + Parameters + ---------- + lattice : Lattice + The lattice to link elements with + """ self.lattice = lattice @abstractmethod @@ -74,6 +82,19 @@ def _test_at_element( @abstractmethod def get_element_identifier(self, element: Element) -> LinkerIdentifier: + """ + Get the identifier for linking an element. + + Parameters + ---------- + element : Element + The element to get the identifier for + + Returns + ------- + LinkerIdentifier + The identifier for the element + """ pass def _iter_matches(self, identifier: LinkerIdentifier) -> Iterable[at.Element]: diff --git a/pyaml/magnet/corrector.py b/pyaml/magnet/corrector.py index 606495b6..fc9de129 100644 --- a/pyaml/magnet/corrector.py +++ b/pyaml/magnet/corrector.py @@ -18,13 +18,50 @@ def __init__(self, corr: Magnet): self._mag = corr def get(self) -> float: + """ + Get the corrector kick angle. + + Returns + ------- + float + Kick angle in radians + """ return np.arctan(self._mag.strength.get()) def set(self, value: float): + """ + Set the corrector kick angle. + + Parameters + ---------- + value : float + Kick angle to set in radians + """ self._mag.strength.set(np.tan(value)) def set_and_wait(self, value: float): + """ + Set the kick angle and wait for it to reach the setpoint. + + Parameters + ---------- + value : float + Target kick angle in radians + + Raises + ------ + NotImplementedError + This method is not yet implemented + """ raise NotImplementedError("Not implemented yet.") def unit(self) -> str: + """ + Get the unit for the kick angle. + + Returns + ------- + str + Unit string, always 'rad' for radians + """ return "rad" diff --git a/pyaml/magnet/hcorrector.py b/pyaml/magnet/hcorrector.py index eb9b670f..964c4e29 100644 --- a/pyaml/magnet/hcorrector.py +++ b/pyaml/magnet/hcorrector.py @@ -8,7 +8,10 @@ PYAMLCLASS = "HCorrector" -class ConfigModel(MagnetConfigModel): ... +class ConfigModel(MagnetConfigModel): + """Configuration model for Horizontal Corrector magnet.""" + + ... class HCorrector(Magnet): diff --git a/pyaml/magnet/magnet.py b/pyaml/magnet/magnet.py index c73a69f6..528a570d 100644 --- a/pyaml/magnet/magnet.py +++ b/pyaml/magnet/magnet.py @@ -13,8 +13,16 @@ class MagnetConfigModel(ElementConfigModel): + """ + Configuration model for magnet elements. + + Attributes + ---------- + model : MagnetModel or None, optional + Object in charge of converting magnet strengths to power supply values + """ + model: MagnetModel | None = None - """Object in charge of converting magnet strenghts to power supply values""" class Magnet(Element): diff --git a/pyaml/magnet/octupole.py b/pyaml/magnet/octupole.py index 17b296c9..d9710a09 100644 --- a/pyaml/magnet/octupole.py +++ b/pyaml/magnet/octupole.py @@ -5,7 +5,10 @@ PYAMLCLASS = "Octupole" -class ConfigModel(MagnetConfigModel): ... +class ConfigModel(MagnetConfigModel): + """Configuration model for Octupole magnet.""" + + ... class Octupole(Magnet): diff --git a/pyaml/magnet/quadrupole.py b/pyaml/magnet/quadrupole.py index 115d820c..3c720ab6 100644 --- a/pyaml/magnet/quadrupole.py +++ b/pyaml/magnet/quadrupole.py @@ -5,7 +5,10 @@ PYAMLCLASS = "Quadrupole" -class ConfigModel(MagnetConfigModel): ... +class ConfigModel(MagnetConfigModel): + """Configuration model for Quadrupole magnet.""" + + ... class Quadrupole(Magnet): diff --git a/pyaml/magnet/sextupole.py b/pyaml/magnet/sextupole.py index ddfc95d2..e8218ca3 100644 --- a/pyaml/magnet/sextupole.py +++ b/pyaml/magnet/sextupole.py @@ -5,7 +5,10 @@ PYAMLCLASS = "Sextupole" -class ConfigModel(MagnetConfigModel): ... +class ConfigModel(MagnetConfigModel): + """Configuration model for Sextupole magnet.""" + + ... class Sextupole(Magnet): diff --git a/pyaml/magnet/skewoctu.py b/pyaml/magnet/skewoctu.py index 56ed8b84..109edd78 100644 --- a/pyaml/magnet/skewoctu.py +++ b/pyaml/magnet/skewoctu.py @@ -5,7 +5,10 @@ PYAMLCLASS = "SkewOctu" -class ConfigModel(MagnetConfigModel): ... +class ConfigModel(MagnetConfigModel): + """Configuration model for SkewOctu magnet.""" + + ... class SkewOctu(Magnet): diff --git a/pyaml/magnet/skewquad.py b/pyaml/magnet/skewquad.py index 5855ce89..f79e2c30 100644 --- a/pyaml/magnet/skewquad.py +++ b/pyaml/magnet/skewquad.py @@ -5,7 +5,10 @@ PYAMLCLASS = "SkewQuad" -class ConfigModel(MagnetConfigModel): ... +class ConfigModel(MagnetConfigModel): + """Configuration model for SkewQuad magnet.""" + + ... class SkewQuad(Magnet): diff --git a/pyaml/magnet/skewsext.py b/pyaml/magnet/skewsext.py index da0cde57..640d996e 100644 --- a/pyaml/magnet/skewsext.py +++ b/pyaml/magnet/skewsext.py @@ -5,7 +5,10 @@ PYAMLCLASS = "SkewSext" -class ConfigModel(MagnetConfigModel): ... +class ConfigModel(MagnetConfigModel): + """Configuration model for SkewSext magnet.""" + + ... class SkewSext(Magnet): diff --git a/pyaml/magnet/vcorrector.py b/pyaml/magnet/vcorrector.py index a2f3850e..cf3a0d08 100644 --- a/pyaml/magnet/vcorrector.py +++ b/pyaml/magnet/vcorrector.py @@ -7,7 +7,10 @@ PYAMLCLASS = "VCorrector" -class ConfigModel(MagnetConfigModel): ... +class ConfigModel(MagnetConfigModel): + """Configuration model for Vertical Corrector magnet.""" + + ... class VCorrector(Magnet): diff --git a/pyaml/rf/rf_transmitter.py b/pyaml/rf/rf_transmitter.py index 15fcbbbc..daea739d 100644 --- a/pyaml/rf/rf_transmitter.py +++ b/pyaml/rf/rf_transmitter.py @@ -16,18 +16,31 @@ class ConfigModel(ElementConfigModel): + """ + Configuration model for RF Transmitter. + + Attributes + ---------- + voltage : DeviceAccess or None, optional + Device to apply cavity voltage + phase : DeviceAccess or None, optional + Device to apply cavity phase + cavities : list[str] + List of cavity names connected to this transmitter + harmonic : float, optional + Harmonic frequency ratio, 1.0 for main frequency, by default 1.0 + distribution : float, optional + RF distribution (Part of the total RF voltage powered by this transmitter), + by default 1.0 + """ + model_config = ConfigDict(arbitrary_types_allowed=True, extra="forbid") voltage: DeviceAccess | None = None - """Device to apply cavity voltage""" phase: DeviceAccess | None = None - """Device to apply cavity phase""" cavities: list[str] - """List of cavity names connected to this transmitter""" harmonic: float = 1.0 - """Harmonic frequency ratio, 1.0 for main frequency""" distribution: float = 1.0 - """RF distribution (Part of the total RF voltage powered by this transmitter)""" class RFTransmitter(Element): @@ -43,6 +56,19 @@ def __init__(self, cfg: ConfigModel): @property def voltage(self) -> abstract.ReadWriteFloatScalar: + """ + Get the RF voltage accessor. + + Returns + ------- + abstract.ReadWriteFloatScalar + Read/write access to RF voltage + + Raises + ------ + PyAMLException + If transmitter is unattached or has no voltage device defined + """ if self.__voltage is None: raise PyAMLException( f"{str(self)} is unattached or has no voltage device defined" @@ -51,6 +77,19 @@ def voltage(self) -> abstract.ReadWriteFloatScalar: @property def phase(self) -> abstract.ReadWriteFloatScalar: + """ + Get the RF phase accessor. + + Returns + ------- + abstract.ReadWriteFloatScalar + Read/write access to RF phase + + Raises + ------ + PyAMLException + If transmitter is unattached or has no phase device defined + """ if self.__phase is None: raise PyAMLException( f"{str(self)} is unattached or has no phase device defined" @@ -63,6 +102,23 @@ def attach( voltage: abstract.ReadWriteFloatScalar, phase: abstract.ReadWriteFloatScalar, ) -> Self: + """ + Attach voltage and phase attributes to a peer. + + Parameters + ---------- + peer : object + The peer object (simulator or control system) + voltage : abstract.ReadWriteFloatScalar + Voltage accessor to attach + phase : abstract.ReadWriteFloatScalar + Phase accessor to attach + + Returns + ------- + Self + A new attached instance of RFTransmitter + """ # Attach voltage and phase attribute and returns a new reference obj = self.__class__(self._cfg) obj.__voltage = voltage diff --git a/tests/test_arrays.py b/tests/test_arrays.py index eefd7281..45f2a62f 100644 --- a/tests/test_arrays.py +++ b/tests/test_arrays.py @@ -246,6 +246,7 @@ def test_arrays(install_test_package): Factory.clear() + @pytest.mark.parametrize( "sr_file", [ @@ -253,7 +254,9 @@ def test_arrays(install_test_package): ], ) def test_serialized_magnets_arrays(sr_file): - sr: Accelerator = Accelerator.load(sr_file, use_fast_loader=True, ignore_external=True) + sr: Accelerator = Accelerator.load( + sr_file, use_fast_loader=True, ignore_external=True + ) the_serie = sr.design.get_serialized_magnets("series") strength = the_serie.strengths.get() assert len(strength) == 5 @@ -263,4 +266,3 @@ def test_serialized_magnets_arrays(sr_file): assert len(hardwares) == 5 print(hardwares) the_serie.hardwares.set([10]) - diff --git a/tests/test_ranges.py b/tests/test_ranges.py index c9b9a92e..a0bedcd1 100644 --- a/tests/test_ranges.py +++ b/tests/test_ranges.py @@ -10,23 +10,18 @@ # --- scalar with single range --- (3.0, [0.0, 10.0], True), (12.0, [0.0, 10.0], False), - # --- list with matching number of ranges --- ([3.0, 2.0], [0.0, 10.0, 1.0, 5.0], True), ([3.0, 6.0], [0.0, 10.0, 1.0, 5.0], False), - # --- numpy arrays --- (np.array([1.0, 2.0]), [0.0, 2.0, 1.0, 3.0], True), (np.array([1.0, 4.0]), [0.0, 2.0, 1.0, 3.0], False), - # --- None bounds (unbounded side) --- ([3.0, 2.0], [None, 10.0, 1.0, None], True), ([3.0, 0.5], [None, 10.0, 1.0, None], False), - # --- single value checked against ALL ranges (broadcast value) --- (3.0, [0.0, 10.0, -15.0, 15.0], True), (3.0, [0.0, 10.0, 4.0, 15.0], False), - # --- single range applied to ALL values (broadcast range) --- ([1.0, 2.0, 3.0], [0.0, 5.0], True), ([1.0, 6.0, 3.0], [0.0, 5.0], False), @@ -39,8 +34,8 @@ def test_check_range(values, dev_range, expected): @pytest.mark.parametrize( "dev_range", [ - [0.0, 5.0, 0.0], # odd length - np.array([0.0, 5.0, 0.0]) # odd length (numpy) + [0.0, 5.0, 0.0], # odd length + np.array([0.0, 5.0, 0.0]), # odd length (numpy) ], ) def test_check_range_raises_on_odd_dev_range_length(dev_range): diff --git a/tests/test_ranges_cfm_deviceaccess.py b/tests/test_ranges_cfm_deviceaccess.py index 76b506b7..24beaefe 100644 --- a/tests/test_ranges_cfm_deviceaccess.py +++ b/tests/test_ranges_cfm_deviceaccess.py @@ -21,7 +21,9 @@ def _out_of_range(vmin, vmax) -> float: return float(vmax) + 0.1 if vmin is not None: return float(vmin) - 0.1 - raise RuntimeError("Unbounded range [None, None], cannot build an out-of-range value.") + raise RuntimeError( + "Unbounded range [None, None], cannot build an out-of-range value." + ) @pytest.mark.parametrize( @@ -34,7 +36,9 @@ def _out_of_range(vmin, vmax) -> float: ], indirect=["install_test_package"], ) -def test_cfm_ranges_from_yaml_are_propagated_and_enforced(magnet_file, install_test_package): +def test_cfm_ranges_from_yaml_are_propagated_and_enforced( + magnet_file, install_test_package +): sr: Accelerator = Accelerator.load(magnet_file) sr.design.get_lattice().disable_6d() @@ -55,11 +59,13 @@ def test_cfm_ranges_from_yaml_are_propagated_and_enforced(magnet_file, install_t assert got_ranges == expected_ranges # Build an in-range current vector (3 values) - in_currents = np.array([ - _in_range(*expected_ranges[0]), - _in_range(*expected_ranges[1]), - _in_range(*expected_ranges[2]), - ]) + in_currents = np.array( + [ + _in_range(*expected_ranges[0]), + _in_range(*expected_ranges[1]), + _in_range(*expected_ranges[2]), + ] + ) # Convert currents -> strengths (vector size 3) in_strengths = m.model.compute_strengths(in_currents) diff --git a/tests/test_serialized_magnets.py b/tests/test_serialized_magnets.py index 7f3d0003..ad5bd9ce 100644 --- a/tests/test_serialized_magnets.py +++ b/tests/test_serialized_magnets.py @@ -24,7 +24,9 @@ def check_no_diff(array: list[np.float64]) -> bool: ], ) def test_config_load(sr_file): - sr: Accelerator = Accelerator.load(sr_file, use_fast_loader=True, ignore_external=True) + sr: Accelerator = Accelerator.load( + sr_file, use_fast_loader=True, ignore_external=True + ) assert sr is not None magnets = [ sr.design.get_element("QF8B-C04"), diff --git a/tests/test_tune.py b/tests/test_tune.py index 93e0b978..ecc269d6 100644 --- a/tests/test_tune.py +++ b/tests/test_tune.py @@ -6,7 +6,9 @@ def test_tune(): - sr: Accelerator = Accelerator.load("tests/config/EBSTune.yaml", ignore_external=True) + sr: Accelerator = Accelerator.load( + "tests/config/EBSTune.yaml", ignore_external=True + ) sr.design.get_lattice().disable_6d() quadForTuneDesign = sr.design.get_magnets("QForTune") diff --git a/tests/test_tune_hardware.py b/tests/test_tune_hardware.py index 8bd806f8..b4d2ffce 100644 --- a/tests/test_tune_hardware.py +++ b/tests/test_tune_hardware.py @@ -6,7 +6,9 @@ def test_tune(): - sr: Accelerator = Accelerator.load("tests/config/EBSTune.yaml", ignore_external=True) + sr: Accelerator = Accelerator.load( + "tests/config/EBSTune.yaml", ignore_external=True + ) sr.design.get_lattice().disable_6d() quadForTuneDesign = sr.design.get_magnets("QForTune") diff --git a/tests/test_tune_monitor.py b/tests/test_tune_monitor.py index 5bf979c5..1bbbbdb2 100644 --- a/tests/test_tune_monitor.py +++ b/tests/test_tune_monitor.py @@ -5,7 +5,9 @@ def test_simulator_tune_monitor(): - sr: Accelerator = Accelerator.load("tests/config/tune_monitor.yaml", ignore_external=True) + sr: Accelerator = Accelerator.load( + "tests/config/tune_monitor.yaml", ignore_external=True + ) sr.design.get_lattice().disable_6d() tune_monitor = sr.design.get_betatron_tune_monitor("BETATRON_TUNE") assert tune_monitor.tune.get()[0] == sr.design.get_lattice().get_tune()[0]