Skip to content

Commit 3690126

Browse files
committed
removed typings imports
1 parent e2e54a0 commit 3690126

File tree

7 files changed

+12
-16
lines changed

7 files changed

+12
-16
lines changed

xcube/core/store/fs/accessor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import copy
66
from abc import ABC, abstractmethod
7-
from typing import Any, List, Optional
7+
from typing import Any, Optional
88

99
import fsspec
1010

xcube/core/store/fs/impl/dataset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# https://opensource.org/licenses/MIT.
44

55
from abc import ABC
6-
from typing import List, Optional
6+
from typing import Optional
77

88
import fsspec
99
import rasterio

xcube/core/store/fs/impl/geodataframe.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@
77
import geopandas as gpd
88
import pandas as pd
99

10-
from typing import List
11-
1210
from xcube.util.assertions import assert_instance
1311
from xcube.util.fspath import is_local_fs
1412
from xcube.util.jsonschema import JsonObjectSchema

xcube/core/store/fs/impl/mldataset.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Permissions are hereby granted under the terms of the MIT License:
33
# https://opensource.org/licenses/MIT.
44

5-
from typing import List, Union
5+
from typing import Union
66

77
import xarray as xr
88

xcube/core/store/fs/registry.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
# Permissions are hereby granted under the terms of the MIT License:
33
# https://opensource.org/licenses/MIT.
44

5-
from collections.abc import Sequence
6-
from typing import Any, Callable, List, Literal, Mapping, Optional
5+
from collections.abc import Mapping, Sequence
6+
from typing import Any, Literal, Optional
77

88
import fsspec
99

@@ -252,7 +252,7 @@ def new_fs_data_store(
252252

253253
def get_filename_extensions(
254254
accessor_type: Literal["openers", "writers"] = "openers"
255-
) -> Mapping[str, List[str]]:
255+
) -> Mapping[str, list[str]]:
256256
"""Returns a mapping from filename extensions to lists of
257257
data accessor ids that open data from this format.
258258

xcube/core/store/fs/store.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import warnings
1111
from collections.abc import Container, Iterator, Sequence
1212
from threading import RLock
13-
from typing import Any, Callable, Dict, List, Literal, Optional, Tuple, Union, Mapping
13+
from typing import Any, Callable, Literal, Optional, Tuple, Union, Mapping
1414

1515
import fsspec
1616
import geopandas as gpd
@@ -459,7 +459,7 @@ def _get_format_to_data_type_aliases_writers(self):
459459

460460
@classmethod
461461
def _set_infos_from_extensions(cls, find_extensions, protocol=None) -> (
462-
Tuple)[Dict, Dict]:
462+
Tuple)[dict, dict]:
463463
filename_ext_to_format = {}
464464
format_to_data_type_aliases = {}
465465
predicate = get_data_accessor_predicate(storage_id=protocol)
@@ -673,7 +673,7 @@ def _get_extension(type_alias: str) -> list[Extension]:
673673

674674
def _guess_all_opener_id_parts(
675675
self, data_id: str, data_type: DataTypeLike = None, require=True
676-
) -> List[tuple[str, str, str]]:
676+
) -> list[tuple[str, str, str]]:
677677
return self._guess_all_accessor_id_parts(
678678
self._get_filename_ext_to_format_openers(),
679679
self._get_format_to_data_type_aliases_openers(),
@@ -701,7 +701,7 @@ def _guess_best_writer_id_parts(
701701
def _guess_all_accessor_id_parts(
702702
self, filename_ext_to_format, format_to_data_type_alias,
703703
data_id: str, data_type: DataTypeLike = None, require=True
704-
) -> List[tuple[str, str, str]]:
704+
) -> list[tuple[str, str, str]]:
705705
assert_given(data_id, "data_id")
706706
ext = self._get_filename_ext(data_id)
707707
if data_type:
@@ -881,7 +881,7 @@ def get_data_types(cls) -> tuple[str, ...]:
881881
@classmethod
882882
def get_filename_extensions(
883883
cls, accessor_type: Literal["openers", "writers"] = "openers"
884-
) -> Mapping[str, List[str]]:
884+
) -> Mapping[str, list[str]]:
885885
"""Returns a mapping from filename extensions to lists of
886886
data accessor ids that open data from this format.
887887

xcube/plugin.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
# Permissions are hereby granted under the terms of the MIT License:
33
# https://opensource.org/licenses/MIT.
44

5-
from typing import List
6-
75
from xcube.constants import (
86
EXTENSION_POINT_CLI_COMMANDS,
97
EXTENSION_POINT_DATA_OPENERS,
@@ -153,7 +151,7 @@ def _register_data_accessors(ext_registry: extension.ExtensionRegistry):
153151
# noinspection PyShadowingNames
154152
def _add_fs_data_accessor_ext(
155153
point: str, ext_type: str, protocol: str, data_type: str, format_id: str,
156-
file_extensions: List[str]
154+
file_extensions: list[str]
157155
):
158156
factory_args = (protocol, data_type, format_id)
159157
loader = extension.import_component(factory, call_args=factory_args)

0 commit comments

Comments
 (0)