mirror of
https://github.com/triqs/dft_tools
synced 2024-12-22 04:13:47 +01:00
Reading misc_input files only if present
This commit is contained in:
parent
c19babd33a
commit
8db46b16b5
@ -395,7 +395,7 @@ class Wien2kConverter(ConverterTools):
|
||||
|
||||
band_window = [numpy.zeros((n_k, 2), dtype=int) for isp in range(SP + 1 - SO)]
|
||||
for isp, f in enumerate(files):
|
||||
if not os.path.exists(f): raise IOError, "convert_misc_input: File %s does not exist" %f
|
||||
if os.path.exists(f):
|
||||
mpi.report("Reading input from %s..."%f)
|
||||
|
||||
R = ConverterTools.read_fortran_file(self, f, self.fortran_to_replace)
|
||||
@ -415,7 +415,7 @@ class Wien2kConverter(ConverterTools):
|
||||
# lattice_constants: unit cell parameters in a. u.
|
||||
# lattice_angles: unit cell angles in rad
|
||||
|
||||
if not (os.path.exists(self.struct_file)) : raise IOError, "convert_misc_input: File %s does not exist" %self.struct_file
|
||||
if (os.path.exists(self.struct_file)):
|
||||
mpi.report("Reading input from %s..."%self.struct_file)
|
||||
|
||||
with open(self.struct_file) as R:
|
||||
@ -433,7 +433,7 @@ class Wien2kConverter(ConverterTools):
|
||||
#######################################
|
||||
# rot_symmetries: matrix representation of all (space group) symmetry operations
|
||||
|
||||
if not (os.path.exists(self.outputs_file)) : raise IOError, "convert_misc_input: File %s does not exist" %self.outputs_file
|
||||
if (os.path.exists(self.outputs_file)):
|
||||
mpi.report("Reading input from %s..."%self.outputs_file)
|
||||
|
||||
rot_symmetries = []
|
||||
@ -457,7 +457,6 @@ class Wien2kConverter(ConverterTools):
|
||||
except IOError:
|
||||
raise "convert_misc_input: reading file %s failed" %self.outputs_file
|
||||
|
||||
|
||||
# Save it to the HDF:
|
||||
ar=HDFArchive(self.hdf_file,'a')
|
||||
if not (misc_subgrp in ar): ar.create_group(misc_subgrp)
|
||||
|
Loading…
Reference in New Issue
Block a user