Conversation
Fix docstrings whose Parameters section did not match the function signature, for private helpers and functions not exported to the API docs. - Add missing parameter entries (e.g. qdp._line_type delimiter, _sip_fit order/coeff_names, periodic_fit nterms_base/nterms_band/reg_*, is_fits filepath/fileobj). - Correct wrong names (SAMPHubServer._retry_method recipient_public_id, write_mrt cosmo, _prepare_then_do_arithmetic operation). - Fix numpydoc formatting: 'name: type' -> 'name : type'; rewrite the sortmore docstring with a proper Parameters section; move a trailing paragraph out of the Parameters section in _array_to_file. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
|
Thank you for your contribution to Astropy! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.
|
1 task
Member
|
Same comment as #20437 (comment) |
Member
|
@taldcroft just FYI I am fixing all the WCSAxes docstrings in #20434 (review) |
mhvk
approved these changes
Sep 18, 2026
mhvk
left a comment
Contributor
There was a problem hiding this comment.
OK for table, uncertainty, units (numpydoc should be less picky about the space before the colon!).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Companion to #20437. That PR fixed the docstrings of public functions whose
Parameterssection disagreed with the signature; this one covers the remaining 29 hits from the same scan, which are private helpers or functions that are importable but not exported to the API docs (e.g.astropy.modeling.fitting.fitter_to_model_params,astropy.io.ascii.qdp._line_type,astropy.wcs.utils._sip_fit). Nothing here renders on docs.astropy.org, so this is lower priority than #20437 and only matters to people reading the source.The problems are the same two kinds: parameters missing from or misnamed in the docstring (
SAMPHubServer._retry_methoddocumentsrecipient_public_keyfor an argument namedrecipient_public_id;periodic_fitinlombscargle_multibanddocuments a singlentermswhere the signature hasnterms_base,nterms_band,reg_base,reg_band,regularize_by_traceandbands_fit), and numpydoc formatting (name: typewith no space, so the type is parsed as part of the name).Docstrings only; no signature or behavior changes.
_cosmology_not_equalwas flagged but left alone: its documentedformat/outkeywords are injected by@_comparison_decorator, so the docstring is right for the wrapped callable.AI disclosure
This PR includes AI-generated content using Claude Opus 5. I have carefully reviewed the content and fully understand the changes.
Details
Click to expand
Make the docstring
Parameterssection of 29 internal functions and methods match their signature.1. How the mismatches were found
Same scan as #20437:
astfor the signature,numpydoc.docscrape.NumpyDocStringfor the docstring, and a lookup in the stable docs'objects.invto split public from internal. Of 75 mismatches in total, 46 are public (fixed in #20437) and 29 are handled here.2. Real mismatches (missing or wrong names)
Missing entries added:
io.ascii.qdp._line_type/_get_type_from_list_of_lines:delimiter.io.fits.column._VLF.__new__:dtype.io.fits.connect.is_fits:originwas described as "path or file object"; it is the"read"/"write"string. Now documentsorigin,filepath,fileobj,*args,**kwargsthe way the unified I/O identifier protocol passes them (same text asis_votablein DOC: fix signature/docstring parameter mismatches in the public API #20437).modeling.fitting.fitter_to_model_params_array:fit_param_indices.nddata.NDArithmeticMixin._arithmetic_mask:axis(text from_arithmetic).table.scripts.showtable.showtable:args.timeseries...fastchi2_impl.lombscargle_fastchi2:use_fft,trig_sum_kwds(text fromfast_impl).timeseries...lombscargle_multiband.implementations.mle.periodic_fit:bands_fit,nterms_base,nterms_band,reg_base,reg_band,regularize_by_trace(text fromLombScargleMultiband), replacing the stalentermsentry.visualization.wcsaxes.CoordinateHelper._draw_ticks:renderer.wcs.utils._sip_fit:order,coeff_names, including howparams[6:]is laid out.wcs.WCS._fix_ctype:log_message.Wrong names corrected:
cosmology._src.io.builtin.mrt.write_mrt:cosmology->cosmo(positional-only).nddata.NDArithmeticMixin._arithmetic:kwargs->**kwds;_prepare_then_do_arithmetic:operations->operation, and itsResultsection heading (not a numpydoc section) ->Returns.samp.SAMPHubServer._retry_method:recipient_public_key->recipient_public_id.3. Format mismatches
name: type->name : typeincosmology._src.utils.deprecated_keywords(*kws),io.misc.ecsv.read_data(engine_name),modeling.fitting.fitter_to_model_paramsandfitter_to_model_params_array(use_min_max_bounds),modeling.utils._SpecialOperatorsDict.add(operator_name,operator),uncertainty.Distribution._result_as_distribution(ncore_out,axis),utils.decorators.future_keyword_only(names,since),wcs.utils._linear_wcs_fit(lon, lat,x, y,w_obj).io.ascii.misc.sortmore: theParametersblock was a prose line followed by a non-standardKeywordssection withif key: Nonestyle entries. Rewritten as*args,globalkey,keyentries carrying the same information, and theReturnsentry given a name and type.io.fits.util._array_to_file: a trailing paragraph inside theParametersblock moved into the extended summary.units.Quantity._wrap_function:unitandoutwere listed after a prose line ("If present, the following arguments are treated specially") rather than as entries; now all five parameters are entries, in signature order.4. Implementation
All edits are inside docstrings;
git diff --stat upstream/mainis 21 files, 112 insertions, 64 deletions.pre-commit run --files <changed>passes (ruff, codespell, numpydoc-validation). Doctests in the changed modules (qdp.pyhas several):python -m pytest <changed files>gives19 passed.5. Backwards compatibility
No API or behavior change. No changelog fragment, per the "pure doc changes" rule.