Skip to content

Commit

Permalink
fix error tox Union
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahclaude committed Sep 25, 2024
1 parent c956d60 commit bff8648
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/figanos/hvplot/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import warnings
from functools import partial
from pathlib import Path
from typing import Any
from typing import Any, Union

import holoviews as hv
import hvplot # noqa: F401
Expand Down Expand Up @@ -145,7 +145,7 @@ def _plot_ens_pct_stats(

def _plot_timeseries(
name: str,
arr: xr.DataArray | xr.Dataset,
arr: Union[xr.DataArray, xr.Dataset],
array_categ: dict[str, str],
plot_kw: dict[str, Any],
opts_kw: dict[str, Any],
Expand Down Expand Up @@ -250,7 +250,7 @@ def _plot_timeseries(


def timeseries(
data: dict[str, Any] | xr.DataArray | xr.Dataset,
data: Union[dict[str, Any], xr.DataArray, xr.Dataset],
use_attrs: dict[str, Any] | None = None,
plot_kw: dict[str, Any] | None = None,
opts_kw: dict[str, Any] | None = None,
Expand Down
8 changes: 4 additions & 4 deletions src/figanos/hvplot/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ def x_timeseries(data, plot_kw) -> None:

def set_plot_attrs_hv(
use_attrs: dict[str, Any],
xr_obj: xr.DataArray | xr.Dataset,
xr_obj: Union[xr.DataArray, xr.Dataset],
plot_kw: dict[str, Any],
wrap_kw: dict[str, Any] | None = None,
) -> [dict, dict]:
Expand Down Expand Up @@ -522,9 +522,9 @@ def plot_coords_hook(plot, element, text, loc, bgc) -> None:


def plot_coords(
xr_obj: xr.DataArray | xr.Dataset,
loc: str | tuple[float, float] | int,
param: str | None = None,
xr_obj: Union[xr.DataArray, xr.Dataset],
loc: Union[str, tuple[float, float], int],
param: Union[str, None] = None,
backgroundalpha: float = 1,
) -> hv.Text:
"""Plot the coordinates of an xarray object.
Expand Down

0 comments on commit bff8648

Please sign in to comment.