Skip to content

Enable numpydoc docstring validation for astropy.visualization.wcsaxes and fix the issues - #20434

Open
astrofrog wants to merge 7 commits into
astropy:mainfrom
astrofrog:numpydoc-wcsaxes
Open

astrofrog wants to merge 7 commits into
astropy:mainfrom
astrofrog:numpydoc-wcsaxes

Conversation

@astrofrog

Copy link
Copy Markdown
Member

Description

This fixes all the numpydoc issues for the astropy.visualization.wcsaxes module.

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 bulk of this work was carried out by Claude Fable 5, but I have checked everything manually and very carefully and adjusted things as needed.

  • I certify that I am human and that I take full responsibility for this pull request including all interactions with reviewers.

Merge method

  • 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.

@github-actions

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.

…of the matplotlib docstring and avoid cross-referencing PIL in the imshow docstring
…ely empty docstring is needed to block Sphinx docstring inheritance
direction : {'in','out'}, optional
Whether the ticks should point inwards or outwards.
exclude_overlapping : bool, optional
Deprecated, use the ``exclude_overlapping`` option of

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.

Do we need the .. deprecated directive here with the version in which it was deprecated?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Oh I didn't know about that, do we use it elsewhere?

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 think the deprecated decorator inserts into docstring automatically during deprecation period. But with manual addition like this, not sure. Is this even rendered? If not, I guess my comment is moot.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Ok apparently this was deprecated in 3.1 😆

Comment thread astropy/visualization/wcsaxes/coordinate_helpers.py Outdated
Parameters
----------
rule : str
Deprecated and has no effect.

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.

Comment thread astropy/visualization/wcsaxes/core.py Outdated
Comment thread astropy/visualization/wcsaxes/formatter_locator.py Outdated

Parameters
----------
values : `~astropy.units.Quantity` array, optional

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.

number : int, optional
Number of ticks.
The approximate number of ticks.
spacing : `~astropy.units.Quantity` ['angle'], optional

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 was wondering how this ['angle'] would render but I cannot seem to find this class listed in https://astropy--20434.org.readthedocs.build/en/20434/visualization/wcsaxes/index.html#reference-api

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes that class isn't documented as not really intended to be used publicly

Comment thread astropy/visualization/wcsaxes/formatter_locator.py Outdated
Comment thread astropy/visualization/wcsaxes/formatter_locator.py Outdated
Comment thread astropy/visualization/wcsaxes/formatter_locator.py Outdated
astrofrog and others added 2 commits September 18, 2026 22:59
Co-authored-by: P. L. Lim <2090236+pllim@users.noreply.github.com>
@astrofrog

Copy link
Copy Markdown
Member Author

@pllim - I think I've addressed all your comments, and note that the deprecated directives look like this:

Screenshot 2026-09-18 at 23 29 15

I've enabled the PR09 rule

@astrofrog

Copy link
Copy Markdown
Member Author

As to the rendering of [angle], search for 'pressure' here:

https://docs.astropy.org/en/latest/api/astropy.coordinates.AltAz.html

Note that it looks like the rendering is broken, but it should link to the physical type. Need to investigate what's wrong.

@astrofrog

astrofrog commented Sep 18, 2026

Copy link
Copy Markdown
Member Author

The rendering was fixed in astropy/sphinx-astropy#103 but not yet released - anyway this is tangential to this release but just putting it here for the record.

taldcroft added a commit to taldcroft/astropy that referenced this pull request Sep 19, 2026
… summary lines

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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