Skip to content

Fix warnings with Sphinx>4#12270

Closed
saimn wants to merge 6 commits intoastropy:mainfrom
saimn:remove-all-units-coords
Closed

Fix warnings with Sphinx>4#12270
saimn wants to merge 6 commits intoastropy:mainfrom
saimn:remove-all-units-coords

Conversation

@saimn
Copy link
Contributor

@saimn saimn commented Oct 21, 2021

Fix #11725, also see #11763.

Close #13015

This fixes the warnings (example below) by removing the duplicate entries.

astropy/coordinates/builtin_frames/galactic.py:docstring of astropy.coordinates.builtin_frames.galactic.Galactic:1:
WARNING: duplicate object description of astropy.coordinates.builtin_frames.galactic.Galactic,
other instance in api/astropy.coordinates.Galactic, use :noindex: for one of them

Description

This pull request is to address ...

Fixes #

Checklist for package maintainer(s)

This checklist is meant to remind the package maintainer(s) who will review this pull request of some common things to look for. This list is not exhaustive.

  • 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 "When to rebase and squash commits".
  • 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.
  • 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 a milestone set? Milestone must be set but astropy-bot check might be missing; do not let the green checkmark fool you.
  • 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.

@pllim
Copy link
Member

pllim commented Oct 21, 2021

Alas, looks like coordinates is actually explicitly using one of the __all__. Maybe @adrn et al. can advise.

        # and for good measure, check the other ecliptic systems are all the same
        # names for their attributes
        from astropy.coordinates.builtin_frames import ecliptic
>       for frame_name in ecliptic.__all__:
E       AttributeError: module 'astropy.coordinates.builtin_frames.ecliptic' has no attribute '__all__'

@saimn
Copy link
Contributor Author

saimn commented Oct 21, 2021

Hum, and many more Sphinx warnings : (I don't remember seeing this when testing this change a while back)

/home/docs/checkouts/readthedocs.org/user_builds/astropy/checkouts/12270/docs/units/combining_and_defining.rst:86: WARNING: py:meth reference target not found: astropy.units.core.UnitBase.find_equivalent_units
/home/docs/checkouts/readthedocs.org/user_builds/astropy/checkouts/12270/docs/units/conversion.rst:44: WARNING: py:meth reference target not found: astropy.units.core.UnitBase.is_equivalent
/home/docs/checkouts/readthedocs.org/user_builds/astropy/checkouts/12270/docs/units/decomposing_and_composing.rst:9: WARNING: py:obj reference target not found: astropy.units.core.UnitBase.decompose
/home/docs/checkouts/readthedocs.org/user_builds/astropy/checkouts/12270/docs/units/decomposing_and_composing.rst:19: WARNING: py:meth reference target not found: astropy.units.core.UnitBase.decompose
/home/docs/checkouts/readthedocs.org/user_builds/astropy/checkouts/12270/docs/units/decomposing_and_composing.rst:51: WARNING: py:meth reference target not found: astropy.units.core.UnitBase.compose
/home/docs/checkouts/readthedocs.org/user_builds/astropy/checkouts/12270/docs/units/decomposing_and_composing.rst:60: WARNING: py:meth reference target not found: astropy.units.core.UnitBase.compose
/home/docs/checkouts/readthedocs.org/user_builds/astropy/checkouts/12270/docs/units/decomposing_and_composing.rst:125: WARNING: py:meth reference target not found: astropy.units.core.UnitBase.to_system

@pllim
Copy link
Member

pllim commented Oct 21, 2021

many more Sphinx warnings

Oh no... Is this before or after you remove __all__? Nothing jumps to mind on the recent changes to that page.

@adrn
Copy link
Member

adrn commented Oct 22, 2021

Yea, it looks like __all__ is used to get the list of ecliptic frames, but AFAICT it's only used in a single regression test, so we could definitely just modify that test to explicitly list the frames if this makes a bunch of Sphinx warnings go away!
https://github.com/astropy/astropy/blob/main/astropy/coordinates/tests/test_regression.py#L189

@pllim
Copy link
Member

pllim commented Oct 25, 2021

@saimn , feel free to ping for review again once you have addressed Adrian's comment. Thanks!

@pllim
Copy link
Member

pllim commented Oct 27, 2021

RTD is still failing. 😢

@pllim pllim modified the milestones: v5.0, v5.1 Nov 3, 2021
@pllim
Copy link
Member

pllim commented Nov 3, 2021

Moved the milestone.

@dhomeier
Copy link
Contributor

dhomeier commented Feb 6, 2022

@saimn could you rebase – some of those RTD failures look like the warnings that have just been fixed for 5.0.1?

@pllim pllim force-pushed the remove-all-units-coords branch from 1c7b2c5 to a5d3a0d Compare February 8, 2022 05:04
@pllim
Copy link
Member

pllim commented Feb 8, 2022

I rebased, though the CI might be broken due to pytest 7 and scipy 1.8.

@pllim
Copy link
Member

pllim commented Feb 8, 2022

These warnings in RTD log might be related:

/home/docs/checkouts/readthedocs.org/user_builds/astropy/checkouts/12270/docs/units/index.rst:270:<autosummary>:1: WARNING: py:obj reference target not found: astropy.units.abstractmethod
/home/docs/checkouts/readthedocs.org/user_builds/astropy/checkouts/12270/docs/units/index.rst:277:<autosummary>:1: WARNING: py:obj reference target not found: astropy.units.ABCMeta
/home/docs/checkouts/readthedocs.org/user_builds/astropy/checkouts/12270/docs/units/index.rst:447:<autosummary>:1: WARNING: py:obj reference target not found: astropy.units.function.ABCMeta
/home/docs/checkouts/readthedocs.org/user_builds/astropy/checkouts/12270/docs/units/index.rst:447:<autosummary>:1: WARNING: py:obj reference target not found: astropy.units.function.CompositeUnit
/home/docs/checkouts/readthedocs.org/user_builds/astropy/checkouts/12270/docs/units/index.rst:447:<autosummary>:1: WARNING: py:obj reference target not found: astropy.units.function.Quantity
/home/docs/checkouts/readthedocs.org/user_builds/astropy/checkouts/12270/docs/units/index.rst:447:<autosummary>:1: WARNING: py:obj reference target not found: astropy.units.function.Unit
/home/docs/checkouts/readthedocs.org/user_builds/astropy/checkouts/12270/docs/units/index.rst:447:<autosummary>:1: WARNING: py:obj reference target not found: astropy.units.function.UnitBase
/home/docs/checkouts/readthedocs.org/user_builds/astropy/checkouts/12270/docs/units/index.rst:447:<autosummary>:1: WARNING: py:obj reference target not found: astropy.units.function.UnitConversionError
/home/docs/checkouts/readthedocs.org/user_builds/astropy/checkouts/12270/docs/units/index.rst:447:<autosummary>:1: WARNING: py:obj reference target not found: astropy.units.function.UnitTypeError
/home/docs/checkouts/readthedocs.org/user_builds/astropy/checkouts/12270/docs/units/index.rst:447:<autosummary>:1: WARNING: py:obj reference target not found: astropy.units.function.UnitsError
/home/docs/checkouts/readthedocs.org/user_builds/astropy/checkouts/12270/docs/units/index.rst:467:<autosummary>:1: WARNING: py:obj reference target not found: astropy.units.function.logarithmic.CompositeUnit
/home/docs/checkouts/readthedocs.org/user_builds/astropy/checkouts/12270/docs/units/index.rst:467:<autosummary>:1: WARNING: py:obj reference target not found: astropy.units.function.logarithmic.FunctionQuantity
/home/docs/checkouts/readthedocs.org/user_builds/astropy/checkouts/12270/docs/units/index.rst:467:<autosummary>:1: WARNING: py:obj reference target not found: astropy.units.function.logarithmic.FunctionUnitBase
/home/docs/checkouts/readthedocs.org/user_builds/astropy/checkouts/12270/docs/units/index.rst:467:<autosummary>:1: WARNING: py:obj reference target not found: astropy.units.function.logarithmic.Unit
/home/docs/checkouts/readthedocs.org/user_builds/astropy/checkouts/12270/docs/units/index.rst:467:<autosummary>:1: WARNING: py:obj reference target not found: astropy.units.function.logarithmic.UnitConversionError
/home/docs/checkouts/readthedocs.org/user_builds/astropy/checkouts/12270/docs/units/index.rst:467:<autosummary>:1: WARNING: py:obj reference target not found: astropy.units.function.logarithmic.UnitTypeError
/home/docs/checkouts/readthedocs.org/user_builds/astropy/checkouts/12270/docs/units/index.rst:467:<autosummary>:1: WARNING: py:obj reference target not found: astropy.units.function.logarithmic.UnitsError

@saimn
Copy link
Contributor Author

saimn commented Feb 10, 2022

Hum yeah it seems things went worse with the recent sphinx releases. Not sure what to do at this point.

@pllim
Copy link
Member

pllim commented Feb 10, 2022

@astrojuanlu , any ideas? 😱

@pllim
Copy link
Member

pllim commented Mar 24, 2022

Do you think we can do something like astropy/photutils#1306 ?

@pllim pllim force-pushed the remove-all-units-coords branch from a5d3a0d to 2435250 Compare March 30, 2022 21:04
docs/conf.py Outdated
# major.minor, call `check_sphinx_version("X.Y.Z")` here.
check_sphinx_version("1.2.1") # noqa: F405

autosummary_generate = False
Copy link
Member

Choose a reason for hiding this comment

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

@saimn , was this experimental or part of your proposed solution for real?

@pllim
Copy link
Member

pllim commented Mar 30, 2022

Nope. Doesn't work now.

@pllim pllim force-pushed the remove-all-units-coords branch from 5d09b11 to 734aac9 Compare March 30, 2022 21:36
@pllim pllim marked this pull request as draft March 30, 2022 22:07
@saimn
Copy link
Contributor Author

saimn commented Apr 1, 2022

See #13048.

@saimn saimn closed this Apr 1, 2022
@saimn saimn deleted the remove-all-units-coords branch April 12, 2022 20:53
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.

DOC: Unpin max version of Sphinx when Sphinx 4.0.2 is out (and Jinja2)

4 participants