diff --git a/ogstools/meshplotlib/animation.py b/ogstools/meshplotlib/animation.py index 0df18f1cc812e25a312bc0e0e9fcbda54af6d99a..295d97e42b756873e41842e65a034a6c94406e30 100644 --- a/ogstools/meshplotlib/animation.py +++ b/ogstools/meshplotlib/animation.py @@ -1,8 +1,7 @@ import warnings from collections.abc import Sequence from functools import partial -from typing import Optional as Opt -from typing import Union +from typing import Optional, Union import matplotlib as mpl import numpy as np @@ -20,8 +19,8 @@ from .core import _plot_on_figure, plot def animate( mesh_series: MeshSeries, property: Property, - timesteps: Opt[Sequence] = None, - titles: Opt[list[str]] = None, + timesteps: Optional[Sequence] = None, + titles: Optional[list[str]] = None, ) -> FuncAnimation: """ Create an animation for a property of a mesh series with given timesteps. diff --git a/ogstools/meshplotlib/core.py b/ogstools/meshplotlib/core.py index f8567270ff6f0a5a2b14ca42b4800521afd76bd6..682f24fdcafb867a6db86cb6472fcd7d54ee09ee 100644 --- a/ogstools/meshplotlib/core.py +++ b/ogstools/meshplotlib/core.py @@ -2,8 +2,7 @@ import types from copy import deepcopy -from typing import Literal, Union -from typing import Optional as Opt +from typing import Literal, Optional, Union import numpy as np import pyvista as pv @@ -115,7 +114,7 @@ def add_colorbars( property: Property, levels: np.ndarray, pad: float = 0.05, - labelsize: Opt[float] = None, + labelsize: Optional[float] = None, ) -> None: """Add a colorbar to the matplotlib figure.""" cmap, norm = get_cmap_norm(levels, property) @@ -178,7 +177,7 @@ def subplot( mesh: pv.UnstructuredGrid, property: Union[Property, str], ax: plt.Axes, - levels: Opt[np.ndarray] = None, + levels: Optional[np.ndarray] = None, ) -> None: """ Plot the property field of a mesh on a matplotlib.axis. diff --git a/ogstools/physics/nuclearwasteheat/nuclearwaste.py b/ogstools/physics/nuclearwasteheat/nuclearwaste.py index 3377556846152cb681efcc5303c82e8929718b6c..86f417d35ef41876fb6f258c3ba04f207dd9140c 100644 --- a/ogstools/physics/nuclearwasteheat/nuclearwaste.py +++ b/ogstools/physics/nuclearwasteheat/nuclearwaste.py @@ -1,6 +1,5 @@ from dataclasses import dataclass -from typing import Optional as Opt -from typing import Union +from typing import Optional, Union import numpy as np from pint.facets.plain import PlainQuantity @@ -31,7 +30,7 @@ class NuclearWaste: self, t: Union[PlainQuantity, float, np.ndarray], baseline: bool = False, - ncl_id: Opt[int] = None, + ncl_id: Optional[int] = None, time_unit: str = "s", power_unit: str = "W", ) -> Union[float, np.ndarray]: @@ -84,7 +83,7 @@ class Repository: self, t: Union[PlainQuantity, float, np.ndarray], baseline: bool = False, - ncl_id: Opt[int] = None, + ncl_id: Optional[int] = None, time_unit: str = "s", power_unit: str = "W", ) -> Union[float, np.ndarray]: