Skip to content
Snippets Groups Projects
Commit f55fea35 authored by Martin Bergemann's avatar Martin Bergemann :speech_balloon:
Browse files

Fix mypy issues

parent 0c6fcf3f
No related branches found
No related tags found
1 merge request!4Tests
import argparse
import os
from pathlib import Path
from typing import Any, Dict, Generator, Optional, Tuple
from typing import Any, Dict, Generator, List, Optional, Tuple
import xarray as xr
......@@ -16,4 +16,6 @@ def rechunk_netcdf_file(
output_path: Optional[os.PathLike] = ...,
engine: str = ...,
) -> None: ...
def cli() -> None: ...
def cli(
argv: Optional[List[str]] = ...,
) -> None: ...
......@@ -20,7 +20,7 @@ def test_rechunk_data_dir_with_overwrite(data_dir: Path) -> None:
def test_rechunk_data_dir_without_overwrite(data_dir: Path) -> None:
"""Testing the creation of new datafiles from a folder."""
with TemporaryDirectory() as temp_dir:
rechunk_netcdf_file(data_dir, temp_dir)
rechunk_netcdf_file(data_dir, Path(temp_dir))
new_files = sorted(f.relative_to(temp_dir) for f in Path(temp_dir).rglob(".nc"))
old_files = sorted(f.relative_to(data_dir) for f in data_dir.rglob(".nc"))
assert new_files == old_files
......@@ -34,7 +34,7 @@ def test_rechunk_single_data_file(data_file: Path) -> None:
rechunk_netcdf_file(data_file)
assert a_time < float(data_file.stat().st_atime)
with NamedTemporaryFile(suffix=".nc") as temp_file:
rechunk_netcdf_file(data_file, temp_file.name)
rechunk_netcdf_file(data_file, Path(temp_file.name))
assert Path(temp_file.name).exists()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment