Skip to content

Commit 20cd2ca

Browse files
CodyCBakerPhDrly
andauthored
Change download directory to use cache directory (#179)
Also this... Otherwise download timing is biased to whether or not home directory is SSD or HDD, unconfigured for similarity to the rest of the suite --------- Co-authored-by: Ryan Ly <[email protected]>
1 parent 3f6785d commit 20cd2ca

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/nwb_benchmarks/setup/_config.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,11 @@ def clean_cache(ignore_errors: bool = False) -> None:
115115
"""
116116
Clean the cache directory for NWB Benchmarks.
117117
118-
Deletes the entire cache directory if it exists.
118+
Deletes the entire cache directory except for the persistent download subdirectory.
119119
"""
120120
cache_directory = get_cache_directory()
121-
for path in cache_directory.iterdir():
121+
paths = set(cache_directory.iterdir()) - {cache_directory / "downloads"}
122+
for path in paths:
122123
if path.is_dir():
123124
shutil.rmtree(path=path, ignore_errors=ignore_errors)
124125
else:
@@ -135,7 +136,7 @@ def get_persistent_download_directory() -> pathlib.Path:
135136
pathlib.Path
136137
The persistent download directory path.
137138
"""
138-
benchmarks_home_directory = get_benchmarks_home_directory()
139-
download_directory = benchmarks_home_directory / "downloads"
139+
cache_directory = get_cache_directory()
140+
download_directory = cache_directory / "downloads"
140141
download_directory.mkdir(exist_ok=True)
141142
return download_directory

0 commit comments

Comments
 (0)