-
Notifications
You must be signed in to change notification settings - Fork 3
Add NumPy-format docstrings to core modules #183
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
Conversation
Co-authored-by: gubaidulinvadim <2589030+gubaidulinvadim@users.noreply.github.com>
Co-authored-by: gubaidulinvadim <2589030+gubaidulinvadim@users.noreply.github.com>
Co-authored-by: gubaidulinvadim <2589030+gubaidulinvadim@users.noreply.github.com>
Co-authored-by: gubaidulinvadim <2589030+gubaidulinvadim@users.noreply.github.com>
Co-authored-by: gubaidulinvadim <2589030+gubaidulinvadim@users.noreply.github.com>
Co-authored-by: gubaidulinvadim <2589030+gubaidulinvadim@users.noreply.github.com>
def set_energy(self, E: float):
"""
Set the energy for all simulators and control systems.
Parameters
----------
E : float
Energy value to set in eV [not GeV]
""" |
|
I've looked through it. It looks ok as a start to adding the docs consistently. |
GamelinAl
left a comment
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.
The documentation for the fill_array methods is not clear to me but maybe it is because I am not sure to understand the code or what is done there.
| voltage : DeviceAccess or None, optional | ||
| Device to apply cavity voltage | ||
| phase : DeviceAccess or None, optional | ||
| Device to apply cavity phase |
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.
Should we have unit here?
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.
Not sure, for the moment it will take the unit of the control system. It is DeviceAccess (kind of tango proxy equivalent).
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.
Not sure either, should this be a requierement? We ask for unit in V, or it is to the user to provide their value and then whatever is given is the unit used?
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.
For the moment the unit returned by the CS is specified in the DeviceAccess object.
It is possible to get it from TangoDB but for Epics i have no idea if they have a standard.
Then we should implement pint (or an other solution) to provide the unit expected at the PyAML level.
Co-authored-by: GamelinAl <alexis.gamelin@synchrotron-soleil.fr>
Co-authored-by: GamelinAl <alexis.gamelin@synchrotron-soleil.fr>
Co-authored-by: GamelinAl <alexis.gamelin@synchrotron-soleil.fr>
Co-authored-by: GamelinAl <alexis.gamelin@synchrotron-soleil.fr>
|
@JeanLucPons this looks very nice for the documentation. We should try to have this confg+code example at different locations. |

Description
Added 66 docstrings in NumPy format across 33 source files. Focused on high-impact, frequently-used modules to improve code documentation and API clarity.
Related Issue
This addresses the need for comprehensive API documentation following NumPy docstring conventions.
Changes to existing functionality
Testing
No new tests required. Documentation-only changes.
Verify that your checklist complies with the project
Modules Enhanced
Core:
accelerator.py(3) -set_energy(),live,designpropertiesArrays (14): Configuration classes for bpm, element, magnet, cfm_magnet, serialized_magnet;
RWBPMPosition,RWBPMSinglePositionimplementationsBPM (9):
BPMclass properties (model,positions,offset,tilt,attach);BPMModelindex checkersControl (5): Abstract methods in
DeviceAccess,DeviceAccessList;Qualityenum documentationDiagnostics (5):
TuneMonitorandChromaticityMonitorproperties and attachment methodsLattice (3):
LatticeElementsLinkermethods,AttributeLinker.get_element_identifier()Magnet (13):
ConfigModelfor all magnet types (quadrupole, sextupole, octupole, correctors, etc.);RWCorrectorAnglemethodsRF (4):
RFTransmitter.ConfigModel,voltage,phase,attach()Configuration (4):
get_curve(),get_matrix()methods for CSV and inline loadersExample
Remaining Work
~300 docstrings remain across: array implementations (32), element_holder (46), factory/loaders (19), control implementations (63), lattice/simulator (78), magnet models (50), rf_plant (9), tuning_tools (12), external interfaces (6). Can be addressed in future PRs.
Quality Checks
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.