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

DM-32820: Skip ButlerURI in table of contents #613

Merged
merged 2 commits into from Dec 7, 2021
Merged

Conversation

timj
Copy link
Member

@timj timj commented Dec 6, 2021

Aliasing ButlerURI to ResourcePath works fine for code but breaks sphinx documentation building. Workaround this by removing the table of content entry.

Checklist

  • ran Jenkins
  • added a release note for user-visible changes to doc/changes

@codecov
Copy link

codecov bot commented Dec 6, 2021

Codecov Report

Merging #613 (e3fa06e) into main (7439250) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #613   +/-   ##
=======================================
  Coverage   83.78%   83.78%           
=======================================
  Files         231      231           
  Lines       29616    29616           
  Branches     4910     4910           
=======================================
  Hits        24813    24813           
  Misses       3672     3672           
  Partials     1131     1131           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7439250...e3fa06e. Read the comment docs.

@timj timj changed the title DM-32820: Monkey patch ResourcePath to allow for ButlerURI DM-32820: Skip ButlerURI in table of contents Dec 6, 2021
ButlerURI is an alias for ResourcePath and this confusess sphinx,
especially when building pipelines.lsst.io.
Simplest to remove the toc entry completely.

A class stub is given although this does not get linked.
@@ -100,6 +100,12 @@ Python API reference

.. automodapi:: lsst.daf.butler
:no-main-docstr:
:skip: ButlerURI

.. py:class:: lsst.daf.butler.ButlerURI(uri)
Copy link
Member Author

Choose a reason for hiding this comment

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

@jonathansick This does work in the sense that some words appear, but it doesn't result in something that is clickable. Am I doing something wrong? The :skip: fixes the pipelines.lsst.io build problem so it's not important.

Copy link
Member

Choose a reason for hiding this comment

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

What automodapi does, once it detects the available symbols in a namespace, is create rst pages that in turn contain py:class directives and so on. Then it creates an automodsumm in place of the automodapi while creates the click-able table of contents. I'm assuming that this ButlerURI documentation in lsst.daf.butler is only temporary, so I don't think it's worth the trouble to fake the look of automodsumm.

Also note that if there are existing links in the documentation to methods of ButlerURI, you'd technically want to add those methods to your doc for ButlerURI. You'd do this by putting py:method directives inside the scope of the py:class directive. If there aren't such links, I wouldn't worry about it.

Copy link
Member Author

Choose a reason for hiding this comment

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

There aren't any links to methods, just the class. The docs do build fine with this change so I'll leave it. The plan is to do a global replacement of ButlerURI with ResourcePath so I'll leave it as is and merge this to solve the immediate problem of the pipelines.lsst.io build not working.

@@ -100,6 +100,12 @@ Python API reference

.. automodapi:: lsst.daf.butler
:no-main-docstr:
:skip: ButlerURI

.. py:class:: lsst.daf.butler.ButlerURI(uri)
Copy link
Member

Choose a reason for hiding this comment

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

What automodapi does, once it detects the available symbols in a namespace, is create rst pages that in turn contain py:class directives and so on. Then it creates an automodsumm in place of the automodapi while creates the click-able table of contents. I'm assuming that this ButlerURI documentation in lsst.daf.butler is only temporary, so I don't think it's worth the trouble to fake the look of automodsumm.

Also note that if there are existing links in the documentation to methods of ButlerURI, you'd technically want to add those methods to your doc for ButlerURI. You'd do this by putting py:method directives inside the scope of the py:class directive. If there aren't such links, I wouldn't worry about it.

@timj timj merged commit ebe0530 into main Dec 7, 2021
@timj timj deleted the tickets/DM-32820 branch December 7, 2021 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants