mirror of
https://github.com/triqs/dft_tools
synced 2024-09-01 16:53:43 +02:00
![Priyanka Seth](/assets/img/avatar_default.png)
* recompute maps every time SK called rather than saving them * user saves and feeds in chemical potential and dc manually * set_dc sets dc to known values (eg from previous calculations) while calc_dc computes them * find_mu -> calc_mu to match API for other functions
26 lines
625 B
Python
26 lines
625 B
Python
import h5py
|
|
import sys
|
|
import subprocess
|
|
|
|
if len(sys.argv) < 2:
|
|
print "Usage: python clear_h5_output.py archive"
|
|
sys.exit()
|
|
|
|
print """
|
|
This script is to remove any SumkDFT generated output from the h5 archive
|
|
and to restore it to the original post-converter state.
|
|
"""
|
|
|
|
filename = sys.argv[1]
|
|
A = h5py.File(filename)
|
|
for group in ['dft_output','user_data']:
|
|
if group in A: del(A[group])
|
|
A.close()
|
|
|
|
# Repack to reclaim disk space
|
|
retcode = subprocess.call(["h5repack","-i%s"%filename, "-otemphgfrt.h5"])
|
|
if retcode != 0:
|
|
print "h5repack failed!"
|
|
else:
|
|
subprocess.call(["mv","-f","temphgfrt.h5","%s"%filename])
|