Skip to content

Commit 7b6608d

Browse files
committed
Replace all type annotations with 3.10 syntax
1 parent f14d71a commit 7b6608d

File tree

84 files changed

+438
-559
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+438
-559
lines changed

auxiliary_tools/cdat_regression_testing/843-migration-phase3/run-script-model-vs-model/run_script.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# flake8: noqa E501
1919

2020
import os
21-
from typing import Tuple, TypedDict
21+
from typing import TypedDict
2222

2323
from mache import MachineInfo
2424

@@ -259,7 +259,7 @@ def _get_machine_paths() -> MachinePaths:
259259
return machine_paths
260260

261261

262-
def _get_test_data_dirs(machine: str) -> Tuple[str, str]:
262+
def _get_test_data_dirs(machine: str) -> tuple[str, str]:
263263
"""Get the directories for test data based on the machine.
264264
265265
The second path is for using the high frequency grid box output at ARM sites
@@ -272,7 +272,7 @@ def _get_test_data_dirs(machine: str) -> Tuple[str, str]:
272272
273273
Returns
274274
-------
275-
Tuple[str, str]
275+
tuple[str, str]
276276
A tuple of two strings, each representing a test data directory path.
277277
"""
278278
test_data_dirs = None

auxiliary_tools/cdat_regression_testing/843-migration-phase3/run-script-model-vs-obs/run_script.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
import os
2121
import timeit
22-
from typing import Tuple, TypedDict
22+
from typing import TypedDict
2323

2424
from mache import MachineInfo
2525

@@ -248,7 +248,7 @@ def _get_machine_paths() -> MachinePaths:
248248
return machine_paths
249249

250250

251-
def _get_test_data_dirs(machine: str) -> Tuple[str, str]:
251+
def _get_test_data_dirs(machine: str) -> tuple[str, str]:
252252
"""Get the directories for test data based on the machine.
253253
254254
The second path is for using the high frequency grid box output at ARM sites
@@ -261,7 +261,7 @@ def _get_test_data_dirs(machine: str) -> Tuple[str, str]:
261261
262262
Returns
263263
-------
264-
Tuple[str, str]
264+
tuple[str, str]
265265
A tuple of two strings, each representing a test data directory path.
266266
"""
267267
test_data_dirs = None

auxiliary_tools/cdat_regression_testing/843-migration-phase3/run-script-model-vs-obs/run_script_main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
import os
2121
import timeit
22-
from typing import Tuple, TypedDict
22+
from typing import TypedDict
2323

2424
from mache import MachineInfo
2525

@@ -248,7 +248,7 @@ def _get_machine_paths() -> MachinePaths:
248248
return machine_paths
249249

250250

251-
def _get_test_data_dirs(machine: str) -> Tuple[str, str]:
251+
def _get_test_data_dirs(machine: str) -> tuple[str, str]:
252252
"""Get the directories for test data based on the machine.
253253
254254
The second path is for using the high frequency grid box output at ARM sites
@@ -261,7 +261,7 @@ def _get_test_data_dirs(machine: str) -> Tuple[str, str]:
261261
262262
Returns
263263
-------
264-
Tuple[str, str]
264+
tuple[str, str]
265265
A tuple of two strings, each representing a test data directory path.
266266
"""
267267
test_data_dirs = None

auxiliary_tools/cdat_regression_testing/855-perf-benchmark/run-script-model-vs-obs/run_script.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import datetime
2121
import os
2222
import timeit
23-
from typing import Tuple, TypedDict
23+
from typing import TypedDict
2424

2525
from mache import MachineInfo
2626

@@ -247,7 +247,7 @@ def _get_machine_paths() -> MachinePaths:
247247
return machine_paths
248248

249249

250-
def _get_test_data_dirs(machine: str) -> Tuple[str, str]:
250+
def _get_test_data_dirs(machine: str) -> tuple[str, str]:
251251
"""Get the directories for test data based on the machine.
252252
253253
The second path is for using the high frequency grid box output at ARM sites
@@ -260,7 +260,7 @@ def _get_test_data_dirs(machine: str) -> Tuple[str, str]:
260260
261261
Returns
262262
-------
263-
Tuple[str, str]
263+
tuple[str, str]
264264
A tuple of two strings, each representing a test data directory path.
265265
"""
266266
test_data_dirs = None

auxiliary_tools/cdat_regression_testing/855-perf-benchmark/run-script-model-vs-obs/run_script_main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import datetime
2121
import os
2222
import timeit
23-
from typing import Tuple, TypedDict
23+
from typing import TypedDict
2424

2525
from mache import MachineInfo
2626

@@ -249,7 +249,7 @@ def _get_machine_paths() -> MachinePaths:
249249
return machine_paths
250250

251251

252-
def _get_test_data_dirs(machine: str) -> Tuple[str, str]:
252+
def _get_test_data_dirs(machine: str) -> tuple[str, str]:
253253
"""Get the directories for test data based on the machine.
254254
255255
The second path is for using the high frequency grid box output at ARM sites
@@ -262,7 +262,7 @@ def _get_test_data_dirs(machine: str) -> Tuple[str, str]:
262262
263263
Returns
264264
-------
265-
Tuple[str, str]
265+
tuple[str, str]
266266
A tuple of two strings, each representing a test data directory path.
267267
"""
268268
test_data_dirs = None

auxiliary_tools/cdat_regression_testing/861-time-series-multiple/all-ts-datasets/run_script.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
# flake8: noqa E501
1919

2020
import os
21-
from typing import Tuple, TypedDict
21+
from typing import TypedDict
2222

2323
from mache import MachineInfo
2424

@@ -247,7 +247,7 @@ def _get_machine_paths() -> MachinePaths:
247247
return machine_paths
248248

249249

250-
def _get_test_data_dirs(machine: str) -> Tuple[str, str]:
250+
def _get_test_data_dirs(machine: str) -> tuple[str, str]:
251251
"""Get the directories for test data based on the machine.
252252
253253
The second path is for using the high frequency grid box output at ARM sites
@@ -260,7 +260,7 @@ def _get_test_data_dirs(machine: str) -> Tuple[str, str]:
260260
261261
Returns
262262
-------
263-
Tuple[str, str]
263+
tuple[str, str]
264264
A tuple of two strings, each representing a test data directory path.
265265
"""
266266
test_data_dirs = None

auxiliary_tools/cdat_regression_testing/906-v2_complete_run/run_script.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
import os
2121
import timeit
22-
from typing import Tuple, TypedDict
22+
from typing import TypedDict
2323

2424
from mache import MachineInfo
2525

@@ -246,7 +246,7 @@ def _get_machine_paths() -> MachinePaths:
246246
return machine_paths
247247

248248

249-
def _get_test_data_dirs(machine: str) -> Tuple[str, str]:
249+
def _get_test_data_dirs(machine: str) -> tuple[str, str]:
250250
"""Get the directories for test data based on the machine.
251251
252252
The second path is for using the high frequency grid box output at ARM sites
@@ -259,7 +259,7 @@ def _get_test_data_dirs(machine: str) -> Tuple[str, str]:
259259
260260
Returns
261261
-------
262-
Tuple[str, str]
262+
tuple[str, str]
263263
A tuple of two strings, each representing a test data directory path.
264264
"""
265265
test_data_dirs = None

auxiliary_tools/cdat_regression_testing/930-zppy-diffs/v2/debug-large-diffs/debug.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#%%
22
import glob
3-
from typing import List
43

54
import numpy as np
65
import xarray as xr
@@ -72,7 +71,7 @@ def _get_var_data(ds: xr.Dataset, var_key: str) -> np.ndarray:
7271

7372
print(f"Relative tolerance: {RTOL}, Absolute tolerance: {ATOL}")
7473

75-
def compare_files(main_glob: List[str]):
74+
def compare_files(main_glob: list[str]):
7675
for fp_main in main_glob:
7776
var_key = fp_main.split("-")[-3]
7877
fp_type = fp_main.split("-")[-1].split("_")[-1]
@@ -109,7 +108,7 @@ def compare_files(main_glob: List[str]):
109108
compare_files(MAIN_GLOB_DIFF)
110109

111110
# %%
112-
def compare_stats(main_glob_diff: List[str]):
111+
def compare_stats(main_glob_diff: list[str]):
113112
for fp_main in main_glob_diff:
114113
var_key = fp_main.split("-")[-3]
115114
fp_type = fp_main.split("-")[-1].split("_")[-1]

auxiliary_tools/cdat_regression_testing/930-zppy-diffs/v2/debug-omi-tco/debug.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#%%
22
import glob
3-
from typing import List
43

54
import numpy as np
65
import xarray as xr

auxiliary_tools/cdat_regression_testing/940-xesmf-diffs/complete_run/run_script.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
import os
2121
import timeit
22-
from typing import Tuple, TypedDict
22+
from typing import TypedDict
2323

2424
from mache import MachineInfo
2525

@@ -246,7 +246,7 @@ def _get_machine_paths() -> MachinePaths:
246246
return machine_paths
247247

248248

249-
def _get_test_data_dirs(machine: str) -> Tuple[str, str]:
249+
def _get_test_data_dirs(machine: str) -> tuple[str, str]:
250250
"""Get the directories for test data based on the machine.
251251
252252
The second path is for using the high frequency grid box output at ARM sites
@@ -259,7 +259,7 @@ def _get_test_data_dirs(machine: str) -> Tuple[str, str]:
259259
260260
Returns
261261
-------
262-
Tuple[str, str]
262+
tuple[str, str]
263263
A tuple of two strings, each representing a test data directory path.
264264
"""
265265
test_data_dirs = None

0 commit comments

Comments
 (0)