Unverified Commit d41b5c0d authored by Michael Baumgartner's avatar Michael Baumgartner Committed by GitHub
Browse files

Merge pull request #251 from FrankTN/bugfix_248

Fix of issue 248
parents 8032b8d2 0d09f38a
......@@ -180,6 +180,9 @@ def unpack_dataset(folder: Pathlike,
"""
logger.info("Unpacking dataset")
npz_files = subfiles(Path(folder), identifier="*.npz", join=True)
if not npz_files:
logger.warning(f'No paths found in {Path(folder)} matching *.npz')
return
with Pool(processes) as p:
p.starmap(npz2npy, zip(npz_files, repeat(delete_npz)))
......
......@@ -34,7 +34,7 @@ def subfiles(dir_path: Path, identifier: str, join: bool) -> List[str]:
Returns:
List[str]: found paths/file names
"""
paths = list(map(str, list(Path(dir_path).glob(identifier))))
paths = list(map(str, list(Path(os.path.expandvars(dir_path)).glob(identifier))))
if not join:
paths = [p.rsplit(os.path.sep, 1)[-1] for p in paths]
return paths
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment