Skip to content

Commit

Permalink
More old-style type hinting
Browse files Browse the repository at this point in the history
  • Loading branch information
JBorrow committed Sep 12, 2024
1 parent 583a2a5 commit 3525298
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions swiftsimio/visualisation/volume_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
of the particles and projects them onto a grid.
"""

from typing import Literal, Union
from typing import List, Literal, Union
from math import sqrt, exp, pi
from numpy import (
float64,
Expand Down Expand Up @@ -881,12 +881,12 @@ def render_voxel_to_array(data, center, width):

def visualise_render(
render: ndarray,
centers: list[float],
widths: Union[list[float], float],
centers: List[float],
widths: Union[List[float], float],
cmap: str = "viridis",
return_type: Literal["all", "lighten", "add"] = "lighten",
norm: Union[list["plt.Normalize"], "plt.Normalize", None] = None,
) -> tuple[Union[list[ndarray], ndarray], list["plt.Normalize"]]:
norm: Union[List["plt.Normalize"], "plt.Normalize", None] = None,
) -> tuple[Union[List[ndarray], ndarray], List["plt.Normalize"]]:
"""
Visualises a render with multiple centers and widths.
Expand Down Expand Up @@ -961,7 +961,7 @@ def visualise_render(


def visualise_render_options(
centers: list[float], widths: Union[list[float], float], cmap: str = "viridis"
centers: List[float], widths: Union[List[float], float], cmap: str = "viridis"
) -> tuple["plt.Figure", "plt.Axes"]:
"""
Creates a figure of your rendering options. The y-axis is the output value
Expand Down

0 comments on commit 3525298

Please sign in to comment.