Skip to content

Commit 41722e6

Browse files
committed
Sync typing
1 parent d8e64ad commit 41722e6

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ repository = "https://github.com/bopen/xarray-sentinel"
6666
branch = true
6767

6868
[tool.mypy]
69-
plugins = "numpy.typing.mypy_plugin"
7069
strict = true
7170

7271
[[tool.mypy.overrides]]
@@ -75,6 +74,8 @@ module = [
7574
"cfchecker",
7675
"dask",
7776
"fsspec",
77+
"pydantic",
78+
"pydantic.alias_generators",
7879
"rasterio",
7980
"shapely",
8081
"shapely.geometry",

xarray_sentinel/eopf_metadata.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ def to_snake_recursive(
2121
return struct
2222

2323

24-
def fix_lists(struct: dict[str, Any] | list[Any]) -> dict[str, Any] | list[Any]:
25-
fixed = {}
24+
def fix_lists(struct: Any) -> Any:
25+
fixed: Any
2626
if isinstance(struct, dict):
27+
fixed = {}
2728
for k, v in struct.items():
2829
if k == "@count":
2930
continue
@@ -34,7 +35,6 @@ def fix_lists(struct: dict[str, Any] | list[Any]) -> dict[str, Any] | list[Any]:
3435
fixed[k] = fix_lists(fix_lists(struct[k]))
3536
else:
3637
fixed[k] = fix_lists(struct[k])
37-
3838
elif isinstance(struct, list):
3939
fixed = [fix_lists(v) for v in struct]
4040
else:
@@ -43,7 +43,7 @@ def fix_lists(struct: dict[str, Any] | list[Any]) -> dict[str, Any] | list[Any]:
4343

4444

4545
def filter_metadata_dict(image_information: dict[str, Any]) -> dict[str, Any]:
46-
image_information = to_snake_recursive(image_information)
46+
image_information = to_snake_recursive(image_information) # type: ignore
4747
image_information = fix_lists(image_information)
4848
return image_information
4949

@@ -53,10 +53,10 @@ def build_azimuth_fm_rate_list(
5353
) -> list[dict[str, Any] | list[Any]]:
5454
azimuth_fm_rate_list_out: list[dict[str, Any] | list[Any]] = []
5555
for item in azimuth_fm_rate_list:
56-
azimuth_fm_rate_polynomial_str = item["azimuth_fm_rate_polynomial"]["$"]
56+
azimuth_fm_rate_polynomial_str = item["azimuth_fm_rate_polynomial"]["$"] # type: ignore
5757
azimuth_fm_rate_list_out.append(
5858
{
59-
"azimuth_time": item["azimuth_time"],
59+
"azimuth_time": item["azimuth_time"], # type: ignore
6060
"azimuth_fm_rate_polynomial": np.fromstring(
6161
azimuth_fm_rate_polynomial_str, sep=" "
6262
).tolist(),

0 commit comments

Comments
 (0)