Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Feb 3, 2026

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

  • No functional changes - documentation only
  • Pre-commit formatting applied (ruff format modified 22 files)
  • Fixed typo: "ChomaticityMonitor" → "ChromaticityMonitor"

Testing

No new tests required. Documentation-only changes.

Verify that your checklist complies with the project

  • New and existing unit tests pass locally
  • Tests were added to prove that all features/changes are effective (N/A - documentation only)
  • The code is commented where appropriate
  • Any existing features are not broken (unless there is an explicit change to an existing functionality)

Modules Enhanced

Core: accelerator.py (3) - set_energy(), live, design properties

Arrays (14): Configuration classes for bpm, element, magnet, cfm_magnet, serialized_magnet; RWBPMPosition, RWBPMSinglePosition implementations

BPM (9): BPM class properties (model, positions, offset, tilt, attach); BPMModel index checkers

Control (5): Abstract methods in DeviceAccess, DeviceAccessList; Quality enum documentation

Diagnostics (5): TuneMonitor and ChromaticityMonitor properties and attachment methods

Lattice (3): LatticeElementsLinker methods, AttributeLinker.get_element_identifier()

Magnet (13): ConfigModel for all magnet types (quadrupole, sextupole, octupole, correctors, etc.); RWCorrectorAngle methods

RF (4): RFTransmitter.ConfigModel, voltage, phase, attach()

Configuration (4): get_curve(), get_matrix() methods for CSV and inline loaders

Example

def set_energy(self, E: float):
    """
    Set the energy for all simulators and control systems.

    Parameters
    ----------
    E : float
        Energy value to set in GeV
    """

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

  • Security scan: 0 vulnerabilities
  • Code review: 1 typo corrected
  • All docstrings follow NumPy format with Parameters/Returns/Raises sections
Original prompt

Make a Pull request that adds docstrings where they are missing. Docstrings should have numpy docstring format.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 6 commits February 3, 2026 22:16
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>
Copilot AI changed the title [WIP] Add missing docstrings in numpy format Add NumPy-format docstrings to core modules Feb 3, 2026
Copilot AI requested a review from gubaidulinvadim February 3, 2026 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants