Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dataset never decompressed #12

Closed
AaronSpieler opened this issue Mar 4, 2022 · 1 comment
Closed

Dataset never decompressed #12

AaronSpieler opened this issue Mar 4, 2022 · 1 comment

Comments

@AaronSpieler
Copy link

Hello,

I belive I ran into a possible issue here.
Due to line 37 the evaluation in line 38 will always be false if one hasnt already got the uncompressed dataset.

def get_and_gunzip(origin, filename, md5hash=None, cache_dir=None, cache_subdir=None):
gz_file_path = get_file(filename, origin, md5_hash=md5hash, cache_dir=cache_dir, cache_subdir=cache_subdir)
hdf5_file_path = gz_file_path
if not os.path.isfile(hdf5_file_path) or os.path.getctime(gz_file_path) > os.path.getctime(hdf5_file_path):
print("Decompressing %s"%gz_file_path)
with gzip.open(gz_file_path, 'r') as f_in, open(hdf5_file_path, 'wb') as f_out:
shutil.copyfileobj(f_in, f_out)
return hdf5_file_path

If I change line 37 to:
hdf5_file_path = gz_file_path[:-3]
This works for me.

Best,
Aaron

@fzenke
Copy link
Owner

fzenke commented Mar 5, 2022

Thanks for reporting this. When inspecting the code, I also noted that the download cache seems broken.

@fzenke fzenke closed this as completed in 5dcb166 Mar 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants