Skip to content

Commit 54a5c04

Browse files
committed
normalize more type hints
1 parent 096b5ff commit 54a5c04

1 file changed

Lines changed: 15 additions & 15 deletions

File tree

src/eopf_geozarr/conversion/geozarr.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@
1818
import os
1919
import shutil
2020
import time
21-
from collections.abc import Hashable, Iterable, Mapping
22-
from typing import Any, Dict, List, Tuple
21+
from collections.abc import Hashable, Iterable, Mapping, Sequence
22+
from typing import Any, Dict, Tuple
2323

2424
import numpy as np
2525
import xarray as xr
@@ -55,7 +55,7 @@ def create_geozarr_dataset(
5555
min_dimension: int = 256,
5656
tile_width: int = 256,
5757
max_retries: int = 3,
58-
crs_groups: list[str] | None = None,
58+
crs_groups: Iterable[str] | None = None,
5959
gcp_group: str | None = None,
6060
) -> xr.DataTree:
6161
"""
@@ -77,8 +77,8 @@ def create_geozarr_dataset(
7777
Tile width for TMS compatibility
7878
max_retries : int, default 3
7979
Maximum number of retries for network operations
80-
crs_groups : list[str], optional
81-
List of group names that need CRS information added on best-effort basis
80+
crs_groups : Iterabl[str], optional
81+
Iterable of group names that need CRS information added on best-effort basis
8282
gcp_group : str, optional
8383
Group name where GCPs (Ground Control Points) are located.
8484
@@ -228,7 +228,7 @@ def iterative_copy(
228228
min_dimension: int = 256,
229229
tile_width: int = 256,
230230
max_retries: int = 3,
231-
crs_groups: list[str] | None = None,
231+
crs_groups: Iterable[str] | None = None,
232232
gcp_group: str | None = None,
233233
) -> xr.DataTree:
234234
"""
@@ -252,8 +252,8 @@ def iterative_copy(
252252
Tile width for TMS compatibility
253253
max_retries : int, default 3
254254
Maximum number of retries for network operations
255-
crs_groups : list[str], optional
256-
List of group names that need CRS information added on best-effort basis
255+
crs_groups : Iterable[str], optional
256+
Iterable of group names that need CRS information added on best-effort basis
257257
gcp_group : str, optional
258258
Group name where GCPs (Ground Control Points) are located
259259
@@ -273,7 +273,7 @@ def iterative_copy(
273273
storage_options=storage_options,
274274
)
275275

276-
written_groups = set()
276+
written_groups: set[str] = set()
277277
reference_crs = None
278278

279279
# Process all groups in the tree using iterative approach
@@ -811,8 +811,8 @@ def create_native_crs_tile_matrix_set(
811811
Native CRS of the data
812812
native_bounds : tuple
813813
Native bounds (left, bottom, right, top)
814-
overview_levels : list
815-
List of overview level dictionaries
814+
overview_levels : Iterable[OverViewLevelJSON]
815+
Iterable of overview level dictionaries
816816
group_prefix : str, optional
817817
Group prefix for the tile matrix IDs
818818
@@ -883,7 +883,7 @@ def create_overview_dataset_all_vars(
883883
height: int,
884884
native_crs: Any,
885885
native_bounds: Tuple[float, float, float, float],
886-
data_vars: List[Hashable],
886+
data_vars: Sequence[Hashable],
887887
ds_gcp: xr.Dataset | None = None,
888888
) -> xr.Dataset:
889889
"""
@@ -903,8 +903,8 @@ def create_overview_dataset_all_vars(
903903
Native CRS of the data
904904
native_bounds : tuple
905905
Native bounds (left, bottom, right, top)
906-
data_vars : list
907-
List of data variable names to include
906+
data_vars : Sequence[Hashable]
907+
Iterable of data variable names to include
908908
ds_gcp : xr.Dataset, optional
909909
Source dataset with Sentinel-1 ground control points
910910
at native resolution
@@ -1552,7 +1552,7 @@ def _get_lat_coord_attrs() -> StandardLatCoordAttrsJSON:
15521552
}
15531553

15541554

1555-
def _find_grid_mapping_var_name(ds: xr.Dataset, data_vars: list[Hashable]) -> str:
1555+
def _find_grid_mapping_var_name(ds: xr.Dataset, data_vars: Sequence[Hashable]) -> str:
15561556
"""Find the grid_mapping variable name from the dataset."""
15571557
grid_mapping_var_name = ds.attrs.get("grid_mapping", None)
15581558
if not grid_mapping_var_name and data_vars:

0 commit comments

Comments
 (0)