Skip to content

Fix mistakes in time subpackage docstrings / arguments - #20216

Open
taldcroft wants to merge 1 commit into
astropy:mainfrom
taldcroft:time-fix-docstring-arguments
Open

Fix mistakes in time subpackage docstrings / arguments #20216
taldcroft wants to merge 1 commit into
astropy:mainfrom
taldcroft:time-fix-docstring-arguments

Conversation

@taldcroft

Copy link
Copy Markdown
Member

Description

This pull request used AI to audit the astropy/time subpackage for discrepancies in function arguments and docstrings.

  1. TimeBase._apply (stale docstring)
    format and cls were promoted to explicit keyword-only params in the code, but the docstring still described format as something arriving via kwargs and cls was undocumented entirely. Documented both properly and dropped the stale sentence.

  2. TimeDelta.__new__ (dead parameter)
    location=None was in the signature but not the class docstring. Here the docstring was right and the signature was wrong: location is copy-paste residue from Time.__new__ (where it's real). TimeDelta.__init__ never accepted it, so TimeDelta(..., location=...) always raised TypeError — the parameter was unreachable. Removing this parameter does not change the outcome of providing location which would still be a TypeError.

  • By checking this box, the PR author has requested that maintainers do NOT use the "Squash and Merge" button. Maintainers should respect this when possible; however, the final decision is at the discretion of the maintainer that merges the PR.

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

@pllim pllim 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.

I marked this for backport because in general we backport documentation mistakes. However, I also see you changed the signature of __new__. Can that be backported?

Thanks!

@pllim

pllim commented Aug 6, 2026

Copy link
Copy Markdown
Member

Also, GHA is down right now. So if you need CI, we might have to wait it out.

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

Labels

backport-v7.2.x on-merge: backport to v7.2.x backport-v8.0.x on-merge: backport to v8.0.x Bug Docs no-changelog-entry-needed time

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants