From 7ad843ade18485120d27d57f35aefe23f2ed2dc9 Mon Sep 17 00:00:00 2001 From: schobbejak Date: Mon, 26 Aug 2024 22:13:18 +0200 Subject: [PATCH] Remove unused arguments and fix typing --- epochalyst/caching/cacher.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/epochalyst/caching/cacher.py b/epochalyst/caching/cacher.py index 3283a65..c6d5b2d 100644 --- a/epochalyst/caching/cacher.py +++ b/epochalyst/caching/cacher.py @@ -77,6 +77,7 @@ class CacheArgs(TypedDict): LoaderFunction = Callable[[str, Path, str, Any], Any] +StoreFunction = Callable[[str, Path, Any, str, Any], Any] class Cacher(Logger): @@ -283,7 +284,7 @@ def _store_cache(self, name: str, data: Any, cache_args: CacheArgs | None = None output_data_type = cache_args["output_data_type"] store_args = cache_args.get("store_args", {}) - store_functions: Dict[str, LoaderFunction] = { + store_functions: Dict[str, StoreFunction] = { ".npy": self._store_npy, ".parquet": self._store_parquet, ".csv": self._store_csv, @@ -355,7 +356,7 @@ def _store_npy_stack(self, name: str, storage_path: Path, data: Any, output_data else: raise ValueError("output_data_type must be dask_array") - def _store_pkl(self, name: str, storage_path: Path, data: Any, output_data_type: str, store_args: Any) -> None: # noqa: ANN401 + def _store_pkl(self, name: str, storage_path: Path, data: Any, _output_data_type: str, store_args: Any) -> None: # noqa: ANN401 file_path = storage_path / f"{name}.pkl" self.log_to_debug(f"Storing pickle file to {file_path}") with open(file_path, "wb") as f: