Conversation
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.
|
astrofrog
reviewed
Sep 21, 2026
| out : array, optional | ||
| Alternative output array in which to place the result. It must | ||
| have the same shape and buffer length as the expected output, | ||
| but the type (of the output) will be cast if necessary. |
Member
There was a problem hiding this comment.
Just a note to other reviewers that I think this is fine since we list the arguments explicitly in the signature. If we had *args, **kwargs and passed it on it would be more acceptable to just say we pass it on IMHO
Member
|
This does conflicts a little with #20438 . cc @taldcroft |
Member
|
A rebase is also necessary to pick up new changes to |
ShinoKana
force-pushed
the
numpydoc-uncertainty
branch
from
September 22, 2026 01:44
d1e2b83 to
08c2285
Compare
The PR09 numpydoc check was enabled on main after this branch was opened; it flags four descriptions in astropy.uncertainty.distributions.
ShinoKana
force-pushed
the
numpydoc-uncertainty
branch
from
September 26, 2026 04:08
08c2285 to
e776e5f
Compare
This branch has not been deployed
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.
Description
This enables the numpydoc pre-commit check for
astropy.uncertainty(one subpackage of #20353) and fixes the issues it reports.Most of them come from docstrings that describe the parameters in prose rather than in a
Parameterssection, so numpydoc cannot match them against the signature:Distribution.pdf_mean/pdf_std/pdf_varsaid "Arguments are as fornumpy.mean"; these now have properParameterssections.Distribution.pdf_percentiles/pdf_histogramand the threedistributions.pyfactory functions said "Additional keywords are passed into ..." as a trailing sentence; these are now**kwargsentries.broadcast_arraysandconcatenateinfunction_helpers.pyhad noParameterssection at all.The rest are trailing blank lines at the end of a docstring (GL03), missing descriptions for
ArrayDistribution.viewandget_n_samples, and a few things in the private_result_as_distribution(missing space before the colon, no description for the return value).Two descriptions were wrong rather than missing, so I corrected them while I was there:
broadcast_arrays:subokdoes not control whether subclasses ofDistributionare allowed (NdarrayDistributionis one either way). What it controls is whether ndarray subclasses such asQuantityare preserved.concatenate:arrayswas documented as a sequence of array-like, but entries without ashapeare passed straight through tonumpy.concatenate, so a list or a scalar raises. Alsopdf_percentilesreferred to afracsparameter that does not exist and declared the result dimensionless, while it actually keeps the unit of the samples.One exclusion was needed.
Distributiondocumentssamplesin the class docstring but takes it in__new__, and the pre-commit hook only reads signatures from__init__, so it reportssamplesas an unknown parameter. I have added it to[tool.numpydoc_validation] excludewith a comment, but happy to solve it differently if you would rather not carry an exclusion for this.No behaviour changes.
pytest --pyargs astropy.uncertaintypasses (148 passed, 3 skipped), andnumpydoc lintis clean with both numpydoc 1.10.0 (the version pinned in.pre-commit-config.yaml) and 1.11.0.AI Disclosure
If AI tools were used to develop this pull request, describe the tools including specific model and version, how they were used, and what content is AI generated. Otherwise enter "N/A".
The docstring edits were drafted with Claude Opus 5 via Claude Code. I have gone over the full diff myself, and verified locally that
python -m numpydoc.hooks.validate_docstrings astropy/uncertainty/*.pyreports nothing and that the subpackage test suite still passes.Merge method