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

[data][doc] auto-generate dataset api documentation #46557

Merged
merged 1 commit into from
Jul 11, 2024
Merged

Conversation

can-anyscale
Copy link
Collaborator

@can-anyscale can-anyscale commented Jul 11, 2024

This PR auto-generate dataset API documentation, by moving the declaration of API group to the code itself. Also few other fixes to bring consistency between pages.

Test:

Note that the documentation is now consistently documenting a class construction in its full form

Base automatically changed from can-docauto03 to master July 11, 2024 00:40
@can-anyscale can-anyscale force-pushed the can-docauto04 branch 7 times, most recently from 2953a9e to 8f7a7ab Compare July 11, 2024 05:05
@can-anyscale can-anyscale changed the title [data][doc] move some classes to auto-generated [data][doc] auto-generate dataset api documentation Jul 11, 2024
@@ -1,4 +1,5 @@
{{ name | escape | underline}}
{{ name }}
{{ '-' * name | length }}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

change to H2 instead of H1 header type

@@ -401,7 +401,10 @@ def get_api_groups(method_names, class_name, module_name):
cls = getattr(import_module(module_name), class_name)
for method_name in method_names:
method = getattr(cls, method_name)
api_groups.add(safe_getattr(method, "_annotated_api_group", DEFAULT_API_GROUP))
if _is_public_api(method):
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

only need to get api group from public APIs

@@ -1,3 +1,6 @@
.. _dataset-iterator-api:

DataIterator API
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

to be consistent with how dataset api is documented


if "stability" in kwargs:
stability = kwargs["stability"]
assert stability in ["stable", "beta", "alpha"], stability
elif kwargs:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

remove this condition since the key can also be api_group (in addition to stability)

Signed-off-by: can <can@anyscale.com>
Copy link
Member

@bveeramani bveeramani left a comment

Choose a reason for hiding this comment

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

Nice!!

@can-anyscale can-anyscale enabled auto-merge (squash) July 11, 2024 19:47
@github-actions github-actions bot added the go add ONLY when ready to merge, run all tests label Jul 11, 2024
@can-anyscale can-anyscale merged commit f1b6915 into master Jul 11, 2024
7 checks passed
@can-anyscale can-anyscale deleted the can-docauto04 branch July 11, 2024 22:41
Catch-Bull pushed a commit to Catch-Bull/ray that referenced this pull request Jul 15, 2024
This PR auto-generate dataset API documentation, by moving the
declaration of API group to the code itself. Also few other fixes to
bring consistency between pages.

Test:
- dataset page:
https://anyscale-ray--46557.com.readthedocs.build/en/46557/data/api/dataset.html
- navigation page:
https://anyscale-ray--46557.com.readthedocs.build/en/46557/data/api/api.html


Note that the documentation is now consistently documenting a class
construction in its full form

Signed-off-by: can <can@anyscale.com>
Signed-off-by: hejialing.hjl <hejialing.hjl@bytedance.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
go add ONLY when ready to merge, run all tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants