Skip to content

Commit

Permalink
Issue #437 Fix type hint to resolve Sphinx Extension error (sphinx_au…
Browse files Browse the repository at this point in the history
…todoc_typehints)

Error:
Extension error (sphinx_autodoc_typehints):
Handler <function process_docstring at 0x7f5ae8e9c950> for event 'autodoc-process-docstring' threw an exception (exception: module 'matplotlib.colors' has no attribute 'ColorMap')

Cause:
Typehint was previously using different casing for `Colormap`.
Also, this type hint was encoded as a string before, but now we can use a regular type hint.
  • Loading branch information
JohanKJSchreurs committed Sep 4, 2023
1 parent 401bbfc commit 85252b8
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions openeo/udf/xarraydatacube.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,18 +156,18 @@ def save_to_file(self, path: Union[str, Path], fmt=None, **kwargs):
raise ValueError(fmt)

def plot(
self,
title: str = None,
limits=None,
show_bandnames: bool = True,
show_dates: bool = True,
show_axeslabels: bool = False,
fontsize: float = 10.,
oversample: float = 1,
cmap: Union[str, 'matplotlib.colors.ColorMap'] = 'RdYlBu_r',
cbartext: str = None,
to_file: str = None,
to_show: bool = True
self,
title: str = None,
limits=None,
show_bandnames: bool = True,
show_dates: bool = True,
show_axeslabels: bool = False,
fontsize: float = 10.0,
oversample: float = 1,
cmap: Union[str, matplotlib.colors.Colormap] = "RdYlBu_r",
cbartext: str = None,
to_file: str = None,
to_show: bool = True,
):
"""
Visualize a :py:class:`XarrayDataCube` with matplotlib
Expand Down

0 comments on commit 85252b8

Please sign in to comment.