-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Conversation
a6f67c7
to
2cca635
Compare
2953a9e
to
8f7a7ab
Compare
@@ -1,4 +1,5 @@ | |||
{{ name | escape | underline}} | |||
{{ name }} | |||
{{ '-' * name | length }} |
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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>
8f7a7ab
to
bb122d8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!!
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>
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