Skip to content

Commit

Permalink
python3.8 typing backward compat
Browse files Browse the repository at this point in the history
  • Loading branch information
tasansal committed Nov 18, 2022
1 parent d58f38e commit c644890
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/mdio/segy/utilities.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
"""More utilities for reading SEG-Ys."""


from typing import List
from __future__ import annotations

from typing import Sequence
from typing import Tuple
from typing import Union

import numpy as np
import numpy.typing as npt
Expand All @@ -23,7 +22,7 @@ def get_grid_plan(
index_lengths: Sequence[int],
binary_header: dict,
return_headers: bool = False,
) -> Union[List[Dimension], Tuple[List[Dimension], npt.ArrayLike]]:
) -> list[Dimension] | tuple[list[Dimension], npt.ArrayLike]:
"""Infer dimension ranges, and increments.
Generates multiple dimensions with the following steps:
Expand Down Expand Up @@ -74,7 +73,10 @@ def get_grid_plan(


def segy_export_rechunker(
chunks: tuple[int], shape: tuple[int], dtype: npt.DTypeLike, limit: str = "300M"
chunks: tuple[int],
shape: tuple[int],
dtype: npt.DTypeLike,
limit: str = "300M",
) -> tuple[int]:
"""Determine chunk sizes for writing out SEG-Y given limit.
Expand Down

0 comments on commit c644890

Please sign in to comment.