Skip to content

Add Args/Returns sections to calibration API docstrings - #548

Open
xuanku-001 wants to merge 3 commits into
European-XFEL:masterfrom
xuanku-001:docs/calibration-args-returns
Open

xuanku-001 wants to merge 3 commits into
European-XFEL:masterfrom
xuanku-001:docs/calibration-args-returns

Conversation

@xuanku-001

Copy link
Copy Markdown

Summary

Adds Args/Returns/Raises sections to the docstrings of the public
calibration API, following the style already used elsewhere in the codebase
(e.g. components/dld.py, components/pulses.py, components/xgm.py).

  • calibration/calcat.py: setup_client, set_default_caldb_root, and the
    five CalCatAPIClient methods (format_time, request, get, get_paged,
    post)
  • calibration/constants.py: SingleConstant.ndarray,
    CalibrationData.require_calibrations, CalibrationData.select_calibrations
  • calibration/detector.py: DetectorData.list_by_instrument

All existing sentences are preserved verbatim; only sections are added, so no
behaviour or signatures change. These docstrings are rendered on the
documentation site via mkdocstrings, where parameters, return values and
raised errors are currently not described.

I deliberately left the select_trains/split_trains methods and the
constant metadata helpers untouched: their docstrings refer to the upstream
extra_data documentation on purpose, and adding parameter sections there
would just duplicate it.

Testing

  • python -m py_compile passes on all touched files
  • AST statement counts are unchanged (documentation only, no executable lines
    added)

This contribution was prepared with AI assistance (a local LLM-based agent harness with deterministic checks and human review).

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.

1 participant