Skip to content

Commit

Permalink
Merge pull request hackingmaterials#302 from tboland1/master
Browse files Browse the repository at this point in the history
Update to glue_tasks.py CopyVaspOutputs
  • Loading branch information
computron authored Aug 30, 2019
2 parents ded674b + 71c9c00 commit cdea1f5
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions atomate/vasp/firetasks/glue_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
flow of the workflow, e.g. tasks to check stability or the gap is within a certain range.
"""

import shutil
import gzip
import os
import re
Expand Down Expand Up @@ -128,11 +129,8 @@ def copy_files(self):
# unzip the .gz if needed
if gz_ext in ['.gz', ".GZ"]:
# unzip dest file
f = gzip.open(dest_path + gz_ext, 'rt')
file_content = f.read()
with open(dest_path, 'w') as f_out:
f_out.writelines(file_content)
f.close()
with open(dest_path, 'wb') as f_out, gzip.open(dest_path + gz_ext, 'rb') as f_in:
shutil.copyfileobj(f_in, f_out)
os.remove(dest_path + gz_ext)


Expand Down

0 comments on commit cdea1f5

Please sign in to comment.