Skip to content

Unpin Sphinx - #14093

Closed
saimn wants to merge 8 commits into
astropy:mainfrom
saimn:sphinx4
Closed

saimn wants to merge 8 commits into
astropy:mainfrom
saimn:sphinx4

Conversation

@saimn

@saimn saimn commented Dec 2, 2022

Copy link
Copy Markdown
Contributor

Ref #11725 and astropy/sphinx-automodapi#150

So basically using :noindex: with astropy/sphinx-automodapi#150 works in the sense that it removes the duplication warnings from Sphinx. But then for Astropy we get other warnings/errors about missing references ...

@github-actions

github-actions Bot commented Dec 2, 2022

Copy link
Copy Markdown
Contributor

👋 Thank you for your draft pull request! Do you know that you can use [ci skip] or [skip ci] in your commit messages to skip running continuous integration tests until you are ready?

@saimn

saimn commented Dec 2, 2022

Copy link
Copy Markdown
Contributor Author

Example of the new warnings with this PR:

.../astropy/coordinates/builtin_frames/hadec.py:docstring of astropy.coordinates.builtin_frames.hadec.HADec:1: WARNING: py:class reference target not found: astropy.coordinates.baseframe.BaseCoordinateFrame
.../astropy/coordinates/builtin_frames/hcrs.py:docstring of astropy.coordinates.builtin_frames.hcrs.HCRS:1: WARNING: py:class reference target not found: astropy.coordinates.builtin_frames.baseradec.BaseRADecFrame
.../astropy/coordinates/builtin_frames/ecliptic.py:docstring of astropy.coordinates.builtin_frames.ecliptic.HeliocentricEclipticIAU76:1: WARNING: py:class reference target not found: astropy.coordinates.builtin_frames.ecliptic.BaseEclipticFrame
.../astropy/coordinates/builtin_frames/ecliptic.py:docstring of astropy.coordinates.builtin_frames.ecliptic.HeliocentricMeanEcliptic:1: WARNING: py:class reference target not found: astropy.coordinates.builtin_frames.ecliptic.BaseEclipticFrame
.../astropy/coordinates/builtin_frames/ecliptic.py:docstring of astropy.coordinates.builtin_frames.ecliptic.HeliocentricTrueEcliptic:1: WARNING: py:class reference target not found: astropy.coordinates.builtin_frames.ecliptic.BaseEclipticFrame

@pllim

pllim commented Dec 2, 2022

Copy link
Copy Markdown
Member

@adrn , can we simplify coordinates? 😆

@adrn

adrn commented Dec 5, 2022

Copy link
Copy Markdown
Member

Hm, for the warnings in coordinates, is this because the Base*Frame API pages were being generated by the index made from automodapi'ing astropy.coordinates.builtin_frames?

@pllim

pllim commented Dec 5, 2022

Copy link
Copy Markdown
Member

@saimn or @larrybradley might remember...

@saimn

saimn commented Dec 6, 2022

Copy link
Copy Markdown
Contributor Author

See #14115.

@saimn saimn closed this Dec 6, 2022
@mhvk

mhvk commented Dec 6, 2022

Copy link
Copy Markdown
Contributor

@saimn - can you re-open this? I fixed astropy.units at least which should give an idea about how to proceed... I tried pushing to your branch and suspect that failed because the PR is closed.

@pllim pllim reopened this Dec 6, 2022
@pllim

pllim commented Dec 6, 2022

Copy link
Copy Markdown
Member

I reopened it though this might need a rebase by now...

@saimn

saimn commented Dec 6, 2022

Copy link
Copy Markdown
Contributor Author

I thought this PR was not needed/useful, do we still need :noindex: if we change the way to document those subpackages ?

@mhvk

mhvk commented Dec 6, 2022

Copy link
Copy Markdown
Contributor

I'm using :noindex: in astropy.units.function. Perhaps we can indeed just not show it, but maybe it is good to just test that it works?

@mhvk

mhvk commented Dec 6, 2022

Copy link
Copy Markdown
Contributor

I think I may have it down to one that I don't quite understand, but we'll see. Also, need to check whether :noindex: is indeed necessary, but time to start preparing some dinner now!

@mhvk

mhvk commented Dec 7, 2022

Copy link
Copy Markdown
Contributor

OK, I was wrong -- still lots in coordinates. I think it does need a :noindex: in builtin_frames after all (somehow the local built seemed better). But at least some progress!

@Cadair

Cadair commented Dec 7, 2022

Copy link
Copy Markdown
Member

Ok, so at least one of the issues with the coordinates stuff is the inheritance diagram, i.e. it generates a load of errors, I shall hunt down all the others and figure it out.

@Cadair

Cadair commented Dec 7, 2022

Copy link
Copy Markdown
Member

omg it passed.

=============

.. automodapi:: astropy.coordinates
:skip: ICRS

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.

This obviously isn't great (it's the whole contents of the __all__). I don't think it substantially detracts from the documentation of this page (although maybe it needs a note to say things aren't listed here?). Ideally of course we would have a way of excluding objects on namespace, i.e. do something like :exclude-namespace: astropy.coordinates.builtin_frames but 🤷‍♂️

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.

As long as we add a line that says "go here for frame classes" or something, I think this is acceptable if it is the only way we can unpin Sphinx max version.

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.

The classes are listed in the block above, so it's not that hard to spot but I am happy to add a line.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Maybe good to see if we can change the transformgraph view to not link to classes - that seems to be the problem (and even now we cannot click on it anyway)

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.

Is there actually a problem, other than the links inside the graph not working? (I am not sure they did to begin with)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I thought so for a bit, but now am really unsure what is actually causing what problems. Really, these many skip shouldn't be necessary...

@@ -509,11 +510,12 @@ def __init__(self, *args, **kwargs):

@classmethod
def get_roll0(cls):

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.

Unrelated... but we might need a get_roll20 🤓

Comment thread docs/conf.py
"astropy": None,
"matplotlib": "https://matplotlib.org/stable/",
"numpy": "https://numpy.org/doc/stable/",
# The numpy search js isn't loadable at the moment (2022-12-07)

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.

Wait, what?

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.

This was causing an error, and it's because the JS is missing some quotes apparently 🤷‍♂️

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.

But I don't see any such failure in other PRs. Is the JS only used for this PR?

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.

Oooo is the JS only used if you unpin Sphinx? Is this something we have to report to numpy?

Comment thread setup.cfg
s3fs>=2022.8.2
docs =
sphinx<4
sphinx

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.

Also change the Jinja2 pin back to this:

Jinja2>=3.0

@mhvk

mhvk commented Dec 7, 2022

Copy link
Copy Markdown
Contributor

Nice!!! I think now you narrowed it down we should be able to get rid of the problems with the graph. It seems like we do not really need :noindex: -- I think we can simply omit astropy.units.function (though will think a bit more about that).

@pllim

pllim commented Dec 7, 2022

Copy link
Copy Markdown
Member

Given all the work Simon has poured into making noindex work, I feel like we are obligated to use it. 😆

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

Note that Sphinx 5.2 introduced a new feature (that is on by default) with a table of contents for functions and classes. That text overflows the left side bar window in the astropy sphinx theme. See, e.g., from this PR: https://astropy--14093.org.readthedocs.build/en/14093/api/astropy.table.Table.html#astropy.table.Table

Fortunately, Sphinx 5.2.3 added a configuration option to turn it off: set toc_object_entries = False in docs.conf.

xref: astropy/photutils#1424
xref: https://github.com/astropy/photutils/pull/1465/files

@mhvk

mhvk commented Dec 7, 2022

Copy link
Copy Markdown
Contributor

I think I've got an alternative without :noindex: by using automodule instead of automodapi. Maybe easiest to make a separate PR so it is easier to compare.

as suggested by larrybradley
@pllim

pllim commented Dec 7, 2022

Copy link
Copy Markdown
Member

I pushed a commit to address #14093 (review) . Thanks, @larrybradley !

@mhvk mhvk mentioned this pull request Dec 7, 2022
8 of 10 tasks
@mhvk

mhvk commented Dec 7, 2022

Copy link
Copy Markdown
Contributor

See #14140 for my alternative -- I think it is cleaner.

@Cadair

Cadair commented Dec 9, 2022

Copy link
Copy Markdown
Member

Closed in favour of #14140

@Cadair Cadair closed this Dec 9, 2022
@saimn
saimn deleted the sphinx4 branch December 11, 2022 17:59
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.

6 participants