Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unpin Sphinx #14093

Closed
wants to merge 8 commits into from
Closed

Unpin Sphinx #14093

wants to merge 8 commits into from

Conversation

saimn
Copy link
Contributor

@saimn saimn commented Dec 2, 2022

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

github-actions bot commented Dec 2, 2022

👋 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
Copy link
Contributor Author

saimn commented Dec 2, 2022

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
Copy link
Member

pllim commented Dec 2, 2022

@adrn , can we simplify coordinates? 😆

@adrn
Copy link
Member

adrn commented Dec 5, 2022

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
Copy link
Member

pllim commented Dec 5, 2022

@saimn or @larrybradley might remember...

@saimn
Copy link
Contributor Author

saimn commented Dec 6, 2022

See #14115.

@saimn saimn closed this Dec 6, 2022
@mhvk
Copy link
Contributor

mhvk commented Dec 6, 2022

@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
Copy link
Member

pllim commented Dec 6, 2022

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

@saimn
Copy link
Contributor Author

saimn commented Dec 6, 2022

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

@mhvk
Copy link
Contributor

mhvk commented Dec 6, 2022

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
Copy link
Contributor

mhvk commented Dec 6, 2022

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
Copy link
Contributor

mhvk commented Dec 7, 2022

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
Copy link
Member

Cadair commented Dec 7, 2022

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
Copy link
Member

Cadair commented Dec 7, 2022

omg it passed.

@@ -566,3 +566,35 @@ Reference/API
=============

.. automodapi:: astropy.coordinates
:skip: ICRS
Copy link
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
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
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
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
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
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
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 🤓

@@ -335,7 +335,9 @@
"reference_url": {
"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
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
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
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
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?

@@ -97,8 +97,9 @@ all =
fsspec[http]>=2022.8.2
s3fs>=2022.8.2
docs =
sphinx<4
sphinx
Copy link
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
Copy link
Contributor

mhvk commented Dec 7, 2022

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
Copy link
Member

pllim commented Dec 7, 2022

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

Copy link
Member

@larrybradley larrybradley left a comment

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
Copy link
Contributor

mhvk commented Dec 7, 2022

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
Copy link
Member

pllim commented Dec 7, 2022

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

@mhvk mhvk mentioned this pull request Dec 7, 2022
10 tasks
@mhvk
Copy link
Contributor

mhvk commented Dec 7, 2022

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

@Cadair
Copy link
Member

Cadair commented Dec 9, 2022

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.

None yet

6 participants