Skip to content

MAINT: add typehint example #169

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 9 commits into from
Oct 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ instance/
.scrapy

# Sphinx documentation
doc/build/
docs/build/
docs/source/api/_autosummary
docs/source/examples

# PyBuilder
.pybuilder/
Expand Down
3 changes: 3 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,9 @@
"sphinx_gallery.gen_gallery",
]

typehints_defaults = "comma"
simplify_optional_unions = False

# Intersphinx mapping
intersphinx_mapping = {
"python": ("https://docs.python.org/dev", None),
Expand Down
2 changes: 1 addition & 1 deletion requirements/requirements_docs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ sphinx-notfound-page==0.8.3
sphinx-copybutton==0.5.0
sphinx-gallery==0.11.1
ansys_sphinx_theme==0.6.0
sphinx-autodoc-typehints
sphinx-autodoc-typehints==1.19.1
12 changes: 6 additions & 6 deletions src/ansys/dpf/post/result_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ def _sort_fields_container_with_labels(self, option_id, display_option):
new_fields_container.add_field(label, field)
return new_fields_container

def plot_contour(self, display_option: str = "time", option_id=1, **kwargs):
def plot_contour(self, display_option: str = "time", option_id: int = 1, **kwargs):
"""Plot the contour result on its mesh support.

The obtained figure depends on the support, which can be a
Expand All @@ -333,11 +333,11 @@ def plot_contour(self, display_option: str = "time", option_id=1, **kwargs):

Parameters
----------
display_option : str, optional
Name of the label to display. The default is ``"time"``.
option_id: int, optional
Label ID to display. The default is ``1``.
**kwargs : optional
display_option :
Name of the label to display.
option_id :
Label ID to display.
**kwargs :
Additional keyword arguments for the plotter. For keyword
arguments, see ``help(pyvista.plot)``.

Expand Down