Skip to content

Commit

Permalink
avoid unnecessary unzipping
Browse files Browse the repository at this point in the history
  • Loading branch information
AlbertDominguez committed Dec 11, 2024
1 parent e28baa3 commit 3561f09
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions spotiflow/utils/get_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from six.moves.urllib.parse import urlsplit
import numpy as np
import zipfile
from pathlib import Path
from urllib.request import urlretrieve


Expand Down Expand Up @@ -594,9 +595,7 @@ def __call__(self, block_num, block_size, total_size):
return untar_fpath

if extract:
_extract_archive(fpath, datadir, archive_format)

out_dir = Path(fpath).with_suffix("")
if not out_dir.exists() or download:
_extract_archive(fpath, datadir, archive_format)
return fpath


# ----------

0 comments on commit 3561f09

Please sign in to comment.