Skip to content

Commit bc70d00

Browse files
committed
Fixed docstring to avoid duplicate warning in BPM
1 parent e3ae2fd commit bc70d00

File tree

5 files changed

+29
-18
lines changed

5 files changed

+29
-18
lines changed

docs/gen_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ def generate_toctree(filename: str, title: str, level: int, module: str):
132132
file.write(".. toctree::\n")
133133

134134
file.write(" :maxdepth: 1\n")
135-
file.write(" :caption: PyAML packages:\n\n")
135+
file.write(f" :caption: {title}:\n\n")
136136

137137
for p in level_path:
138138
module_name = module + "." + p

pyaml/accelerator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class ConfigModel(BaseModel):
4242
Element family
4343
description : str , optional
4444
Acceleration description
45-
devices : list[Element]
45+
devices : list[.common.element.Element]
4646
Element list
4747
"""
4848

pyaml/arrays/array.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@
1111

1212
class ArrayConfigModel(BaseModel):
1313
"""
14-
Base class for array configuration
14+
Base class for configuration of array of :py:class:`~pyaml.arrays.element.Element`,
15+
:py:class:`~pyaml.arrays.bpm.BPM`, :py:class:`~pyaml.arrays.magnet.Magnet` or
16+
:py:class:`~pyaml.arrays.cfm_magnet.CombinedFunctionMagnet`.
1517
1618
Parameters
1719
----------
1820
name : str
19-
Family name
21+
Name of the array
2022
elements : list[str]
2123
List of pyaml element names
2224
"""
@@ -37,12 +39,15 @@ def __init__(self, cfg: ArrayConfigModel):
3739

3840
def fill_array(self, holder: ElementHolder):
3941
"""
40-
Fill array with elements from the holder.
42+
Fill array with elements from the holder and add the array to
43+
the holder.
4144
4245
Parameters
4346
----------
4447
holder : ElementHolder
45-
The element holder to populate
48+
The element holder (:py:class:`~pyaml.lattice.simulator.Simulator`
49+
or :py:class:`~pyaml.control.controlsystem.ControlSystem`) to
50+
populate with the array.
4651
4752
Raises
4853
------

pyaml/arrays/bpm.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66

77

88
class ConfigModel(ArrayConfigModel):
9-
"""Configuration model for BPM array."""
9+
"""Configuration model for :py:class:`.BPMArray`."""
1010

1111

1212
class BPM(ArrayConfig):
1313
"""
14-
BPM array configuration
14+
:py:class:`.BPMArray` configuration.
1515
1616
Example
1717
-------
@@ -27,7 +27,8 @@ class BPM(ArrayConfig):
2727
- BPM_C04-02
2828
- BPM_C04-03
2929
30-
A BPM array configuration can also be created by code using the following example:
30+
A :py:class:`.BPMArray` configuration can also be created by code using the
31+
following example:
3132
3233
.. code-block:: python
3334
@@ -44,8 +45,11 @@ def __init__(self, cfg: ArrayConfigModel):
4445

4546
def fill_array(self, holder: ElementHolder):
4647
"""
47-
Fill the :py:class:`.BPMArray` using element holder. This method is called
48-
when an :py:class:`~pyaml.accelerator.Accelerator` is loaded but can be
48+
Fill the :py:class:`.BPMArray` using element holder
49+
(:py:class:`~pyaml.lattice.simulator.Simulator`
50+
or :py:class:`~pyaml.control.controlsystem.ControlSystem`)
51+
and add the array to the holder. This method is called when an
52+
:py:class:`~pyaml.accelerator.Accelerator` is loaded but can be
4953
used to create arrays by code as shown bellow:
5054
5155
.. code-block:: python
@@ -60,6 +64,6 @@ def fill_array(self, holder: ElementHolder):
6064
Parameters
6165
----------
6266
holder : ElementHolder
63-
The element holder to populate the BPM array with
67+
The element holder to populate the :py:class:`.BPMArray` with.
6468
"""
6569
holder.fill_bpm_array(self._cfg.name, self._cfg.elements)

pyaml/arrays/bpm_array.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class RWBPMPosition(ReadFloatArray):
1818
----------
1919
name : str
2020
Name of the position accessor
21-
bpms : list[BPM]
21+
bpms : list[pyaml.bpm.bpm.BPM]
2222
List of BPM objects to access
2323
"""
2424

@@ -80,7 +80,7 @@ class RWBPMSinglePosition(ReadFloatArray):
8080
----------
8181
name : str
8282
Name of the position accessor
83-
bpms : list[BPM]
83+
bpms : list[pyaml.bpm.bpm.BPM]
8484
List of BPM objects to access
8585
idx : int
8686
Index for the position axis (0 for horizontal, 1 for vertical)
@@ -134,23 +134,25 @@ def set_aggregator(self, agg: DeviceAccessList):
134134

135135
class BPMArray(ElementArray):
136136
"""
137-
Class that implements access to a BPM array
137+
Class that implements access to a BPM array.
138138
139139
Parameters
140140
----------
141141
arrayName : str
142142
Array name
143-
bpms : list[BPM]
143+
bpms : list[pyaml.bpm.bpm.BPM]
144144
BPM list, all elements must be attached to the same instance of
145-
either a Simulator or a ControlSystem.
145+
either a (:py:class:`~pyaml.lattice.simulator.Simulator`
146+
or a :py:class:`~pyaml.control.controlsystem.ControlSystem`).
146147
use_aggregator : bool
147148
Use aggregator to increase performance by using paralell
148149
access to underlying devices.
149150
150151
Example
151152
-------
152153
153-
An array can be retrieved from the configuration as in the following example:
154+
An array can be retrieved from the configuration as in the following
155+
example:
154156
155157
.. code-block:: python
156158

0 commit comments

Comments
 (0)