Skip to content

Commit

Permalink
adopt py310 typing (#517)
Browse files Browse the repository at this point in the history
  • Loading branch information
bjlittle authored Nov 20, 2023
1 parent 9be5dd0 commit 2e33315
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 11 deletions.
3 changes: 1 addition & 2 deletions src/geovista/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

from importlib.resources import files
import os
from typing import Union

import pooch
import pyvista as pv
Expand All @@ -29,7 +28,7 @@
]

# Type aliases.
TextureLike = Union[str, pv.Texture]
TextureLike = str | pv.Texture

#: Base URL for geovista resources.
BASE_URL: str = "https://github.com/bjlittle/geovista-data/raw/{version}/data/"
Expand Down
4 changes: 1 addition & 3 deletions src/geovista/crs.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
"""
from __future__ import annotations

from typing import Union

import numpy as np
from pyproj import CRS
import pyvista as pv
Expand All @@ -28,7 +26,7 @@
]

# type aliases
CRSLike = Union[int, str, dict, CRS]
CRSLike = int | str | dict | CRS

#: EPSG projection parameter for longitude of natural origin/central meridian
EPSG_CENTRAL_MERIDIAN: str = "8802"
Expand Down
3 changes: 1 addition & 2 deletions src/geovista/examples/uber_h3.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
from functools import partial
from itertools import combinations
from pathlib import Path
from typing import Union

try:
import h3
Expand All @@ -36,7 +35,7 @@
MDI = -1

#: Type alias
H3AssetLike = Union[str, PolyData]
H3AssetLike = str | PolyData
H3Indexes = set[str]


Expand Down
3 changes: 1 addition & 2 deletions src/geovista/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@
from __future__ import annotations

from types import ModuleType
from typing import Union

import pyvista
import scooby

__all__ = ["Report"]

# type aliases
PackageLike = Union[ModuleType, str]
PackageLike = ModuleType | str

#: Default number of package columns in report HTML table.
NCOL: int = 3
Expand Down
3 changes: 1 addition & 2 deletions src/geovista/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

from collections.abc import Iterable
from enum import Enum
from typing import Union

import numpy as np
from numpy.typing import ArrayLike
Expand All @@ -24,7 +23,7 @@

# type aliases
CellIDs = list[int]
CellIDLike = Union[int, CellIDs]
CellIDLike = int | CellIDs
NearestNeighbours = tuple[ArrayLike, ArrayLike]

#: The default kd-tree nearest neighbour epsilon.
Expand Down

0 comments on commit 2e33315

Please sign in to comment.