Skip to content

Fix four docstring parameter names that do not match the signature - #778

Merged
ManonMarchand merged 2 commits into
astropy:mainfrom
karpovantonme:fix/docstring-param-names
Aug 4, 2026
Merged

Fix four docstring parameter names that do not match the signature#778
ManonMarchand merged 2 commits into
astropy:mainfrom
karpovantonme:fix/docstring-param-names

Conversation

@karpovantonme

Copy link
Copy Markdown
Contributor

Problem

Four docstrings name a parameter the function does not take, so the parameter that is really there goes undocumented and the one in the docs cannot be passed.

File Documented Actual signature
registry/rtcons.py:1044 spec def __init__(self, times, *, inclusive=False)
dal/sia2.py:166 url def __init__(self, baseurl, *, capability_description=None, ...)
utils/xml/elements.py:30 object def parse_for_object(source, object_type, ...)
mivot/utils/mivot_utils.py:296 as_literal def populate_instance(..., as_literals=True, ...)

The mivot_utils.py one is a dropped s, and the same line reads (default isTrue) with the space missing.

sia2.py needed care: the module level search() at line 119 genuinely takes url, so that docstring is correct and untouched. Only the SIA2Service constructor at 166 was wrong.

Change

Renamed the four in the docstrings to match the signatures. Docstrings only, no code touched.

Checks

$ python -m pytest pyvo -q
519 passed, 107 skipped, 1 xfailed

Found by a script that pulls every numpydoc Parameters name out of a docstring and compares it against the identifiers in the signature below it. It reported these four before the change and none after. All four were read by hand before touching.

Two more things I noticed, not included here

dal/tests/test_query.py:586 has two statements with the assert missing, so test_columnaliases does not actually check them:

record.getbyucd('baz') is None
record.getbyutype('foobaz') is None

I checked that the behaviour is already correct, the test passes either way once the asserts are added, so this is about the test guarding what it claims rather than about a bug. Happy to send it separately, or fold it in here if you would rather have one PR.

dal/sia2.py:166, the same block, documents session and check_baseurl but not capability_description. I left that alone rather than write a description for a parameter whose intent I would be guessing at.

- rtcons.py: TemporalConstraint documents spec, the argument is times
- sia2.py: SIA2Service documents url, the argument is baseurl. The module
  level search() really does take url, so only the class was changed
- elements.py: parse_for_object documents object, the argument is object_type
- mivot_utils.py: populate_instance documents as_literal, the argument is
  as_literals. Same line said 'default isTrue', now 'default is True'

Docstrings only.
@ManonMarchand

Copy link
Copy Markdown
Member

Thank you! For capability_description, it should be a string, and a possible description could be : Optional description of the service.

The two missing asserts could be in a separate PR

@codecov

codecov Bot commented Aug 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.52%. Comparing base (79f1d85) to head (9a165a8).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #778   +/-   ##
=======================================
  Coverage   80.52%   80.52%           
=======================================
  Files          90       90           
  Lines       10352    10352           
=======================================
  Hits         8336     8336           
  Misses       2016     2016           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ManonMarchand ManonMarchand left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving, but I'm not merging right away in case you want to add capability_description

Wording suggested by the maintainer in review.
@ManonMarchand
ManonMarchand merged commit 656a9a2 into astropy:main Aug 4, 2026
13 checks passed
@karpovantonme

Copy link
Copy Markdown
Contributor Author

Added, with your wording. Tests still 519 passed, 107 skipped, 1 xfailed.

I will send the two missing asserts in test_columnaliases separately.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants