You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Expose help and docs from device factory functions. #780
DocsathonTickets that may be tackled during the Docsathon, 27-8th August 2025documentationImprovements or additions to documentationenhancementNew feature or requestpythonPull requests that update Python code
After #597 but also relevant for the current state:
Device classes have docstrings about their capabilities/use/expected behaviour. Specific device factory functions may also have docstrings about their expected behaviour, other usage information. Some combination of these should be presented to the user when they use the python builtin help function on the device_factory_function.
Acceptance Criteria
After importing ixx.device, help(device) gives useful information about using the device, which may include
a description of any parameters that are added by our decorator and either their default or how to find their default
(if provided) docstring of any parameters that may be passed into the decorated function
(if provided) docstring of the device class that is being returned
After some experimenting, if I provide a doc string for my factory, it does use it
>>> help(energy_source)
Help on DeviceFactory in module dodal.beamlines.p60:
energy_source = <energy_source: DeviceFactory() -> dodal.devices...on_analyser.base.energy_sources.DualEnergySource>
My factory doc string
So we need it to use the device doc string if not provided. If provided, add it to the bottom of the factory doc string
DocsathonTickets that may be tackled during the Docsathon, 27-8th August 2025documentationImprovements or additions to documentationenhancementNew feature or requestpythonPull requests that update Python code
Activity
DiamondJoseph commentedon Sep 9, 2024
Note that the
helpmethod uses the docstrings generated via pydoc, which may require that we are using numpydoc style docstrings. @coretl has opinions about the verbosity.coretl commentedon Sep 9, 2024
Really? That SO post seems to be about Spyder.
helpseems to just print what you wrote:oliwenmandiamond commentedon Jan 20, 2026
This is what the output currently looks like when calling help on a device at the moment, e.g ipin from i03 using DeviceManager:
Help on DeviceFactory in module dodal.beamlines.i03 object:
"""Doc string from factory function
oliwenmandiamond commentedon Jan 20, 2026
After some experimenting, if I provide a doc string for my factory, it does use it
So we need it to use the device doc string if not provided. If provided, add it to the bottom of the factory doc string