Skip to content

Match angular_diameter_distance parameter heading to its signature - #20213

Merged
pllim merged 1 commit into
astropy:mainfrom
siddartha018:docs/add-z-param-name
Aug 6, 2026
Merged

pllim merged 1 commit into
astropy:mainfrom
siddartha018:docs/add-z-param-name

Conversation

@siddartha018

Copy link
Copy Markdown
Contributor

Description

Fixes #20206.

FLRW.angular_diameter_distance has the signature

def angular_diameter_distance(self, z: _InputT, z2: _InputT | None = None, /) -> u.Quantity:

but heads its Parameters section z1, z2. The first parameter is z, so numpydoc pairs the entry with a name the method does not have.

The issue offered two options. This takes the first — rename the heading to z, z2 and leave the prose alone — because the two sibling methods with exactly this signature already do that:

  • comoving_distance(self, z, z2=None, /) heads its section z, z2,
  • comoving_transverse_distance(self, z, z2=None, /) heads its section z, z2,

and both keep explaining the two-argument form in terms of z1, z2 in the description underneath, as this one does. So the heading matches the signature and the wording stays consistent with its neighbours.

One line, docstring only — no signature, call site, or behaviour is touched.

Changelog

Not added: docstring only, so per CONTRIBUTING.md ("in general you do not need to include a changelog entry for minor documentation or test updates") this is not user-visible. Happy to add a fragment or apply no-changelog-entry-needed, whichever you prefer.

The first parameter is z, not z1, and the section heading did not match it.
comoving_distance and comoving_transverse_distance have the same (z, z2)
signature and already head their sections z, z2 while keeping the z1/z2 prose;
this follows them. [ci skip]
@siddartha018
siddartha018 requested a review from a team as a code owner August 5, 2026 21:54
@siddartha018
siddartha018 requested a review from nstarman August 5, 2026 21:54
@github-actions

github-actions Bot commented Aug 5, 2026

Copy link
Copy Markdown
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.

  • Do the proposed changes actually accomplish desired goals?
  • Do the proposed changes follow the Astropy coding guidelines?
  • Are tests added/updated as required? If so, do they follow the Astropy testing guidelines?
  • Are docs added/updated as required? If so, do they follow the Astropy documentation guidelines?
  • Is rebase and/or squash necessary? If so, please provide the author with appropriate instructions. Also see instructions for rebase and squash.
  • Did the CI pass? If no, are the failures related? If you need to run daily and weekly cron jobs as part of the PR, please apply the "Extra CI" label. Codestyle issues can be fixed by the bot.
  • Is a change log needed? If yes, did the change log check pass? If no, add the "no-changelog-entry-needed" label. If this is a manual backport, use the "skip-changelog-checks" label unless special changelog handling is necessary.
  • Is this a big PR that makes a "What's new?" entry worthwhile and if so, is (1) a "what's new" entry included in this PR and (2) the "whatsnew-needed" label applied?
  • At the time of adding the milestone, if the milestone set requires a backport to release branch(es), apply the appropriate "backport-X.Y.x" label(s) before merge.

@nstarman nstarman moved this from Triage to In Progress in Cosmology, the Expansion Aug 6, 2026
@nstarman nstarman moved this from In Progress to Review in progress in Cosmology, the Expansion Aug 6, 2026
@nstarman

nstarman commented Aug 6, 2026

Copy link
Copy Markdown
Member

LGTM. CI is stalled...

@pllim

pllim commented Aug 6, 2026

Copy link
Copy Markdown
Member

CI is stalled because there is a [ci skip] in commit message.

@pllim pllim added this to the v7.2.3 milestone Aug 6, 2026
@pllim pllim added Docs backport-v7.2.x on-merge: backport to v7.2.x backport-v8.0.x on-merge: backport to v8.0.x Bug labels Aug 6, 2026
@pllim

pllim commented Aug 6, 2026

Copy link
Copy Markdown
Member

But given this is trivial docstring fix and RTD is green, if @nstarman approves, I can override the branch protection and merge. Thanks, all!

@github-project-automation github-project-automation Bot moved this from Review in progress to Reviewer approved in Cosmology, the Expansion Aug 6, 2026
@pllim
pllim merged commit 00913dd into astropy:main Aug 6, 2026
3 checks passed
@github-project-automation github-project-automation Bot moved this from Reviewer approved to Done in Cosmology, the Expansion Aug 6, 2026
@lumberbot-app

This comment was marked as resolved.

@pllim

pllim commented Aug 6, 2026

Copy link
Copy Markdown
Member

Not applicable to the code in v7.2.x after all. I updated the milestone. FYI.

pllim added a commit that referenced this pull request Aug 6, 2026
pllim added a commit that referenced this pull request Aug 6, 2026
…213-on-v8.0.x

Backport PR #20213 on branch v8.0.x (Match angular_diameter_distance parameter heading to its signature)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

angular_diameter_distance documents z1 while the parameter is z

3 participants