-
Notifications
You must be signed in to change notification settings - Fork 168
v4 Reference API using autoapi #2395
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
Merged
Merged
Changes from 14 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
068f995
implement autoapi
44711f0
Merge branch 'v4-dev' into reference-api-v4
reint-fischer 7723c87
reorder imports in __init__
a5d7a64
add autoAPI template
07b65a7
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] f4513ec
edit autoapi template + add class on separate page
3aa1037
add class template
c233a50
restructure API pages to have classes on separate pages
2082b12
Merge branch 'v4-dev' into reference-api-v4
reint-fischer 916520e
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] 80d6187
enable docstring checking in public files
352113a
Merge branch 'v4-dev' into reference-api-v4
reint-fischer db731f5
add parcels.Particle docstring
c25a3ae
Merge branch 'v4-dev' into reference-api-v4
erikvansebille 3bbf6f1
Merge branch 'v4-dev' into reference-api-v4
reint-fischer 1ce4772
address suggestions from github review
070fb66
fix typos
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,95 @@ | ||
| {% if obj.display %} | ||
| {% if is_own_page %} | ||
| {{ obj.id }} | ||
| {{ "=" * obj.id | length }} | ||
| {% endif %} | ||
| {% set visible_children = obj.children|selectattr("display")|list %} | ||
| {% set own_page_children = visible_children|selectattr("type", "in", own_page_types)|list %} | ||
| {% if is_own_page and own_page_children %} | ||
| .. toctree:: | ||
| :hidden: | ||
| {% for child in own_page_children %} | ||
| {{ child.include_path }} | ||
| {% endfor %} | ||
| {% endif %} | ||
| .. py:{{ obj.type }}:: {% if is_own_page %}{{ obj.id }}{% else %}{{ obj.short_name }}{% endif %}{% if obj.args %}({{ obj.args }}){% endif %} | ||
|
|
||
| {% for (args, return_annotation) in obj.overloads %} | ||
| {{ " " * (obj.type | length) }} {{ obj.short_name }}{% if args %}({{ args }}){% endif %} | ||
|
|
||
| {% endfor %} | ||
| {% if obj.bases %} | ||
| {% if "show-inheritance" in autoapi_options %} | ||
|
|
||
| Bases: {% for base in obj.bases %}{{ base|link_objs }}{% if not loop.last %}, {% endif %}{% endfor %} | ||
| {% endif %} | ||
| {% if "show-inheritance-diagram" in autoapi_options and obj.bases != ["object"] %} | ||
| .. autoapi-inheritance-diagram:: {{ obj.obj["full_name"] }} | ||
| :parts: 1 | ||
| {% if "private-members" in autoapi_options %} | ||
| :private-bases: | ||
| {% endif %} | ||
|
|
||
| {% endif %} | ||
| {% endif %} | ||
| {% if obj.docstring %} | ||
| {{ obj.docstring|indent(3) }} | ||
| {% endif %} | ||
| {% for obj_item in visible_children %} | ||
| {% if obj_item.type not in own_page_types %} | ||
| {{ obj_item.render()|indent(3) }} | ||
| {% endif %} | ||
| {% endfor %} | ||
| {% if is_own_page and own_page_children %} | ||
| {% set visible_methods = visible_children|selectattr("type", "equalto", "method")|list %} | ||
| {% if visible_methods %} | ||
| Methods | ||
| ------- | ||
|
|
||
| .. autoapisummary:: | ||
|
|
||
| {% for method in visible_methods %} | ||
| {{ method.id }} | ||
| {% endfor %} | ||
|
|
||
|
|
||
| {% endif %} | ||
| {% set visible_attributes = visible_children|selectattr("type", "equalto", "attribute")|list %} | ||
| {% if visible_attributes %} | ||
| Attributes | ||
| ---------- | ||
|
|
||
| .. autoapisummary:: | ||
|
|
||
| {% for attribute in visible_attributes %} | ||
| {{ attribute.id }} | ||
| {% endfor %} | ||
|
|
||
|
|
||
| {% endif %} | ||
| {% set visible_exceptions = own_page_children|selectattr("type", "equalto", "exception")|list %} | ||
| {% if visible_exceptions %} | ||
| Exceptions | ||
| ---------- | ||
|
|
||
| .. autoapisummary:: | ||
|
|
||
| {% for exception in visible_exceptions %} | ||
| {{ exception.id }} | ||
| {% endfor %} | ||
|
|
||
|
|
||
| {% endif %} | ||
| {% set visible_classes = own_page_children|selectattr("type", "equalto", "class")|list %} | ||
| {% if visible_classes %} | ||
| Classes | ||
| ------- | ||
|
|
||
| .. autoapisummary:: | ||
|
|
||
| {% for klass in visible_classes %} | ||
| {{ klass.id }} | ||
| {% endfor %} | ||
| {% endif %} | ||
| {% endif %} | ||
| {% endif %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,156 @@ | ||
| {% if obj.display %} | ||
| {% if is_own_page %} | ||
| {{ obj.id }} | ||
| {{ "=" * obj.id|length }} | ||
|
|
||
| .. py:module:: {{ obj.name }} | ||
|
|
||
| {% if obj.docstring %} | ||
| .. autoapi-nested-parse:: | ||
|
|
||
| {{ obj.docstring|indent(3) }} | ||
|
|
||
| {% endif %} | ||
|
|
||
| {% block content %} | ||
| {% set visible_children = obj.children|selectattr("display")|list %} | ||
| {% if visible_children %} | ||
| {% set visible_classes = visible_children|selectattr("type", "equalto", "class")|list %} | ||
| {% if visible_classes %} | ||
| {% if "class" in own_page_types or "show-module-summary" in autoapi_options %} | ||
| Classes | ||
| ------- | ||
|
|
||
| {% if "class" in own_page_types %} | ||
| .. toctree:: | ||
| :hidden: | ||
| :caption: Classes | ||
|
|
||
| {% for klass in visible_classes %} | ||
| {{ klass.include_path }} | ||
| {% endfor %} | ||
|
|
||
| {% endif %} | ||
| .. autoapisummary:: | ||
|
|
||
| {% for klass in visible_classes %} | ||
| {{ klass.id }} | ||
| {% endfor %} | ||
| {% endif %} | ||
|
|
||
|
|
||
| {% endif %} | ||
| {% set visible_exceptions = visible_children|selectattr("type", "equalto", "exception")|list %} | ||
| {% if visible_exceptions %} | ||
| {% if "exception" in own_page_types or "show-module-summary" in autoapi_options %} | ||
| Exceptions | ||
| ---------- | ||
|
|
||
| {% if "exception" in own_page_types %} | ||
| .. toctree:: | ||
| :hidden: | ||
|
|
||
| {% for exception in visible_exceptions %} | ||
| {{ exception.include_path }} | ||
| {% endfor %} | ||
|
|
||
| {% endif %} | ||
| .. autoapisummary:: | ||
|
|
||
| {% for exception in visible_exceptions %} | ||
| {{ exception.id }} | ||
| {% endfor %} | ||
| {% endif %} | ||
|
|
||
|
|
||
| {% endif %} | ||
| {% set visible_subpackages = obj.subpackages|selectattr("display")|list %} | ||
| {% set visible_submodules = obj.submodules|selectattr("display")|list %} | ||
| {% set visible_submodules = (visible_subpackages + visible_submodules)|sort %} | ||
| {% if visible_submodules %} | ||
| Submodules | ||
| ---------- | ||
|
|
||
| .. toctree:: | ||
| :caption: Submodules | ||
| :maxdepth: 1 | ||
|
|
||
| {% for submodule in visible_submodules %} | ||
| {{ submodule.include_path }} | ||
| {% endfor %} | ||
|
|
||
|
|
||
| {% endif %} | ||
| {% set visible_attributes = visible_children|selectattr("type", "equalto", "data")|list %} | ||
| {% if visible_attributes %} | ||
| {% if "attribute" in own_page_types or "show-module-summary" in autoapi_options %} | ||
| Attributes | ||
| ---------- | ||
|
|
||
| {% if "attribute" in own_page_types %} | ||
| .. toctree:: | ||
| :hidden: | ||
|
|
||
| {% for attribute in visible_attributes %} | ||
| {{ attribute.include_path }} | ||
| {% endfor %} | ||
|
|
||
| {% endif %} | ||
| .. autoapisummary:: | ||
|
|
||
| {% for attribute in visible_attributes %} | ||
| {{ attribute.id }} | ||
| {% endfor %} | ||
| {% endif %} | ||
|
|
||
|
|
||
| {% endif %} | ||
| {% set visible_functions = visible_children|selectattr("type", "equalto", "function")|list %} | ||
| {% if visible_functions %} | ||
| {% if "function" in own_page_types or "show-module-summary" in autoapi_options %} | ||
| Functions | ||
| --------- | ||
|
|
||
| {% if "function" in own_page_types %} | ||
| .. toctree:: | ||
| :hidden: | ||
|
|
||
| {% for function in visible_functions %} | ||
| {{ function.include_path }} | ||
| {% endfor %} | ||
|
|
||
| {% endif %} | ||
| .. autoapisummary:: | ||
|
|
||
| {% for function in visible_functions %} | ||
| {{ function.id }} | ||
| {% endfor %} | ||
| {% endif %} | ||
|
|
||
|
|
||
| {% endif %} | ||
| {% set this_page_children = visible_children|rejectattr("type", "in", own_page_types)|list %} | ||
| {% if this_page_children %} | ||
| {{ obj.type|title }} Contents | ||
| {{ "-" * obj.type|length }}--------- | ||
|
|
||
| {% for obj_item in this_page_children %} | ||
| {{ obj_item.render()|indent(0) }} | ||
| {% endfor %} | ||
| {% endif %} | ||
| {% endif %} | ||
| {% endblock %} | ||
| {% else %} | ||
| .. py:module:: {{ obj.name }} | ||
|
|
||
| {% if obj.docstring %} | ||
| .. autoapi-nested-parse:: | ||
|
|
||
| {{ obj.docstring|indent(6) }} | ||
|
|
||
| {% endif %} | ||
| {% for obj_item in visible_children %} | ||
| {{ obj_item.render()|indent(3) }} | ||
| {% endfor %} | ||
| {% endif %} | ||
| {% endif %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,7 +12,7 @@ _Animation of virtual particles carried by ocean surface flow in the global ocea | |
| You can browse the documentation for older versions by using the version switcher in the bottom right. | ||
| ``` | ||
|
|
||
| **Useful links**: [Installation instructions](getting_started/installation.md) | [Discussions on GitHub](https://github.com/Parcels-code/parcels/discussions) | [Issue on GitHub](https://github.com/Parcels-code/parcels/issues) | [Parcels website](https://parcels-code.org/) | [CLAM community website](https://clam-community.github.io/) | [API reference](reference.md) | ||
| **Useful links**: [Installation instructions](getting_started/installation.md) | [Discussions on GitHub](https://github.com/Parcels-code/parcels/discussions) | [Issue on GitHub](https://github.com/Parcels-code/parcels/issues) | [Parcels website](https://parcels-code.org/) | [CLAM community website](https://clam-community.github.io/) | [API reference](reference/parcels/index) | ||
|
|
||
| `````{grid} 1 2 2 2 | ||
| :gutter: 4 | ||
|
|
@@ -94,7 +94,7 @@ Getting started <getting_started/index> | |
| User guide <user_guide/index> | ||
| Community <community/index> | ||
| Development <development/index> | ||
| API reference <reference> | ||
| API reference <reference/parcels/index> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
| v4 <v4/index> | ||
| Parcels website <https://parcels-code.org/> | ||
| ``` | ||
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.


Uh oh!
There was an error while loading. Please reload this page.