Skip to content

Commit

Permalink
Revert "Remove StringArrayTypes type hint"
Browse files Browse the repository at this point in the history
This reverts commit ce76152.
  • Loading branch information
weiji14 committed Nov 15, 2024
1 parent ce76152 commit ef431af
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pygmt/_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,17 @@
Type aliases for type hints.
"""

import contextlib
import importlib
from collections.abc import Sequence
from typing import Literal

import numpy as np

# Anchor codes
AnchorCode = Literal["TL", "TC", "TR", "ML", "MC", "MR", "BL", "BC", "BR"]

# String array types
StringArrayTypes = Sequence[str] | np.ndarray
with contextlib.suppress(ImportError):
StringArrayTypes |= importlib.import_module(name="pyarrow").StringArray

0 comments on commit ef431af

Please sign in to comment.