Skip to content

Commit

Permalink
fix: read_input_from_hdf error check was not working
Browse files Browse the repository at this point in the history
  • Loading branch information
the-hampel committed Mar 23, 2023
1 parent 701bf8b commit d5cabfe
Showing 1 changed file with 30 additions and 23 deletions.
53 changes: 30 additions & 23 deletions python/triqs_dft_tools/sumk_dft_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,10 +343,11 @@ def dos_parproj_basis(self, mu=None, broadening=None, mesh=None, with_Sigma=True

things_to_read = ['n_parproj', 'proj_mat_all',
'rot_mat_all', 'rot_mat_all_time_inv']
value_read = self.read_input_from_hdf(
subgroup_present, values_not_read = self.read_input_from_hdf(
subgrp=self.parproj_data, things_to_read=things_to_read)
if not value_read:
return value_read
if len(values_not_read) > 0 and mpi.is_master_node:
raise ValueError(
'ERROR: One or more necessary SumK input properties have not been found in the given h5 archive:', self.values_not_read)
if self.symm_op:
self.symmpar = Symmetry(self.hdf_file, subgroup=self.symmpar_data)

Expand Down Expand Up @@ -492,15 +493,17 @@ def elk_dos(self, mu=None, broadening=None, mesh=None, with_Sigma=True, with_dc=

if (pdos):
things_to_read = ['maxlm', 'bc']
value_read = self.read_input_from_hdf(
subgrp=self.bc_data, things_to_read=things_to_read)
if not value_read:
return value_read
subgroup_present, values_not_read = self.read_input_from_hdf(
subgrp=self.bc_data, things_to_read=things_to_read)
if len(values_not_read) > 0 and mpi.is_master_node:
raise ValueError(
'ERROR: One or more necessary SumK input properties have not been found in the given h5 archive:', self.values_not_read)
things_to_read = ['n_atoms']
value_read = self.read_input_from_hdf(
subgrp=self.symmcorr_data, things_to_read=things_to_read)
if not value_read:
return value_read
subgroup_present, values_not_read = self.read_input_from_hdf(
subgrp=self.symmcorr_data, things_to_read=things_to_read)
if len(values_not_read) > 0 and mpi.is_master_node:
raise ValueError(
'ERROR: One or more necessary SumK input properties have not been found in the given h5 archive:', self.values_not_read)

if (mesh is None) and (not with_Sigma):
raise ValueError("lattice_gf: Give the mesh=(om_min,om_max,n_points) for the lattice GfReFreq.")
Expand Down Expand Up @@ -662,10 +665,11 @@ def fs_plot(self, mu=None, broadening=None, mesh=None, FS=True, plane=True, sym=
#read in the energy contour energies and projectors
things_to_read = ['n_k','bmat','symlat','n_symm','vkl',
'n_orbitals', 'proj_mat', 'hopping']
value_read = self.read_input_from_hdf(
subgroup_present, values_not_read = self.read_input_from_hdf(
subgrp=self.fs_data, things_to_read=things_to_read)
if not value_read:
return value_read
if len(values_not_read) > 0 and mpi.is_master_node:
raise ValueError(
'ERROR: One or more necessary SumK input properties have not been found in the given h5 archive:', self.values_not_read)

if with_Sigma is True:
om_mesh = [x.real for x in self.Sigma_imp_w[0].mesh]
Expand Down Expand Up @@ -840,16 +844,18 @@ def spaghettis(self, broadening=None, plot_shift=0.0, plot_range=None, ishell=No
self, "Sigma_imp_w"), "spaghettis: Set Sigma_imp_w first."
things_to_read = ['n_k', 'n_orbitals', 'proj_mat',
'hopping', 'n_parproj', 'proj_mat_all']
value_read = self.read_input_from_hdf(
subgroup_present, values_not_read = self.read_input_from_hdf(
subgrp=self.bands_data, things_to_read=things_to_read)
if not value_read:
return value_read
if len(values_not_read) > 0 and mpi.is_master_node:
raise ValueError(
'ERROR: One or more necessary SumK input properties have not been found in the given h5 archive:', self.values_not_read)
if ishell is not None:
things_to_read = ['rot_mat_all', 'rot_mat_all_time_inv']
value_read = self.read_input_from_hdf(
subgroup_present, values_not_read = self.read_input_from_hdf(
subgrp=self.parproj_data, things_to_read=things_to_read)
if not value_read:
return value_read
if len(values_not_read) > 0 and mpi.is_master_node:
raise ValueError(
'ERROR: One or more necessary SumK input properties have not been found in the given h5 archive:', self.values_not_read)

if mu is None:
mu = self.chemical_potential
Expand Down Expand Up @@ -980,10 +986,11 @@ def partial_charges(self, beta=40, mu=None, with_Sigma=True, with_dc=True):

things_to_read = ['dens_mat_below', 'n_parproj',
'proj_mat_all', 'rot_mat_all', 'rot_mat_all_time_inv']
value_read = self.read_input_from_hdf(
subgroup_present, values_not_read = self.read_input_from_hdf(
subgrp=self.parproj_data, things_to_read=things_to_read)
if not value_read:
return value_read
if len(values_not_read) > 0 and mpi.is_master_node:
raise ValueError(
'ERROR: One or more necessary SumK input properties have not been found in the given h5 archive:', self.values_not_read)
if self.symm_op:
self.symmpar = Symmetry(self.hdf_file, subgroup=self.symmpar_data)

Expand Down

0 comments on commit d5cabfe

Please sign in to comment.