-
Notifications
You must be signed in to change notification settings - Fork 50
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
Return path to decompressed file from decompress_file()
#536
Return path to decompressed file from decompress_file()
#536
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #536 +/- ##
=========================================
Coverage ? 76.49%
=========================================
Files ? 27
Lines ? 1523
Branches ? 320
=========================================
Hits ? 1165
Misses ? 297
Partials ? 61 ☔ View full report in Codecov by Sentry. |
@janosh: This seems like it was perhaps a breaking change. Could you take a look at https://github.com/Quantum-Accelerators/quacc/actions/runs/5790005449/job/15692210083?pr=660 and see if it seems related? |
@janosh: Yeah, actually, seems like this introduce a bug. If the file extension isn't in A better solution would be to have it return |
for f in files: | ||
compress_file(os.path.join(parent, f), compression=compression) | ||
|
||
|
||
def decompress_file(filepath): | ||
def decompress_file(filepath) -> str: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@janosh: Change this to str | None
f_out.writelines(f_in) | ||
os.remove(filepath) | ||
|
||
return out_file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@janosh: move this return
inside the if
statement so that it only returns the string if it's decompressing a file. Otherwise, have it return None
(as before).
Needed for materialsproject/pymatgen#3192 (comment).