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

Autogenerate all API docs #2002

Merged
merged 13 commits into from
Sep 8, 2024
Merged

Autogenerate all API docs #2002

merged 13 commits into from
Sep 8, 2024

Conversation

dstansby
Copy link
Contributor

@dstansby dstansby commented Jun 28, 2024

This updates the doc build to automatically generate all API docs. I've set it so any module with a part that starts with "_" is not documented, so that's the way to make a sub-module private.

See https://zarr--2002.org.readthedocs.build/en/2002/_autoapi/zarr/index.html for the API ref in the build of this PR.

I think it's worth merging this to make sure new additions/removals to the API don't break API docs, and we can bikeshed what's in/out of the public API in a follow up PR.

Fixes #1993.

@jhamman jhamman added V3 documentation Improvements to the documentation labels Jul 1, 2024
@jhamman jhamman added this to the 3.0.0 milestone Jul 1, 2024
@dstansby dstansby marked this pull request as draft July 23, 2024 09:30
@dstansby dstansby force-pushed the autogen branch 4 times, most recently from 09b691b to 26907b2 Compare August 20, 2024 18:34
@dstansby dstansby marked this pull request as ready for review August 20, 2024 18:36
docs/conf.py Outdated
Return True if a module should be skipped in th API docs.
"""
parts = name.split(".")
if what == "module" and any((part.startswith("_") or part == "v2") for part in parts):
Copy link
Member

Choose a reason for hiding this comment

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

can we also skip zarr.core

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Instead of putting in another condition to skip zarr.core, could we rename it to zarr._core instead? This will automatically skip it in the API docs with the current logic, and also signal to folks using autocomplete in their editor that it's not public API.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jhamman I skipped it for now - I think it's worth renaming to zarr.core but it's a big diff so I can propose that in a follow up PR 😄

Copy link
Member

@jhamman jhamman left a comment

Choose a reason for hiding this comment

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

I like this @dstansby. One suggestion but otherwise this looks good.

@dstansby
Copy link
Contributor Author

pre-commit.ci autofix

@dstansby dstansby requested a review from jhamman September 6, 2024 14:16
@dstansby
Copy link
Contributor Author

dstansby commented Sep 6, 2024

pre-commit.ci autofix

@dstansby
Copy link
Contributor Author

dstansby commented Sep 8, 2024

@zarr-developers/python-core-devs would be good to get this reviewed and merged soon before more conflicts with other PRs start coming in 😄

@d-v-b
Copy link
Contributor

d-v-b commented Sep 8, 2024

this looks good to me! thanks for this @dstansby

@d-v-b
Copy link
Contributor

d-v-b commented Sep 8, 2024

it looks like one of the hypothesis tests is failing -- is that related to these changes?

@dstansby
Copy link
Contributor Author

dstansby commented Sep 8, 2024

I can reproduce on v3 branch, I've opened an issue at #2155

@d-v-b
Copy link
Contributor

d-v-b commented Sep 8, 2024

I can reproduce on v3 branch, I've opened an issue at #2155

In that case I'm going to hit merge on this.

@d-v-b d-v-b merged commit 8e29f37 into zarr-developers:v3 Sep 8, 2024
25 of 26 checks passed
@dstansby dstansby deleted the autogen branch September 8, 2024 10:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements to the documentation
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Finish v3 API reference docs
3 participants