dirty fix to enable read cif w/o cell_volume

This commit is contained in:
halvorhv 2022-07-14 21:44:36 +02:00
parent 92075fbb66
commit 4e579bd07b

View file

@ -249,6 +249,10 @@ def write_str(fout, data, options, index=0):
fout.write(f'\t\tbe = lpbe_{label} ;\n') fout.write(f'\t\tbe = lpbe_{label} ;\n')
fout.write(f'\t\tga = lpga_{label} ;\n') fout.write(f'\t\tga = lpga_{label} ;\n')
fout.write('\n') fout.write('\n')
#FIXME fix the if-statement below, so that cell-volume is the correct formula, based on lattice params and angles.
if '_cell_volume' not in atoms.keys():
atoms['_cell_volume'] = 0
else:
fout.write(f'\t\tcell_volume\t vol_{label}_XXXX {atoms["_cell_volume"]}\n') fout.write(f'\t\tcell_volume\t vol_{label}_XXXX {atoms["_cell_volume"]}\n')
fout.write(f'\t\tcell_mass\t mass_{label}_XXXX 1\n') fout.write(f'\t\tcell_mass\t mass_{label}_XXXX 1\n')
fout.write(f'\t\tweight_percent\t wp_{label}_XXXX 100\n\n') fout.write(f'\t\tweight_percent\t wp_{label}_XXXX 100\n\n')
@ -456,7 +460,7 @@ def read_cif(path):
line = cif.readline() line = cif.readline()
print(data.keys())
return data return data