Skip to content

Commit

Permalink
Merge pull request #1459 from pyiron/safer_electronic_structure
Browse files Browse the repository at this point in the history
Change index error in electronic structure to warning
  • Loading branch information
samwaseda authored Jun 21, 2024
2 parents f512ea5 + 12b2d26 commit d94f596
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pyiron_atomistics/sphinx/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2131,9 +2131,12 @@ def get_last(arr):
if self.charge_density.total_data is not None:
self.charge_density.to_hdf(hdf5_output, group_name="charge_density")
if "bands_occ" in self.generic.dft:
es = self._get_electronic_structure_object()
if len(es.kpoint_list) > 0:
es.to_hdf(hdf5_output)
try:
es = self._get_electronic_structure_object()
if len(es.kpoint_list) > 0:
es.to_hdf(hdf5_output)
except IndexError:
warnings.warn("Electronic structure parsing failed")
with hdf5_output.open("electronic_structure") as hdf5_es:
if "dos" not in hdf5_es.list_groups():
hdf5_es.create_group("dos")
Expand Down

0 comments on commit d94f596

Please sign in to comment.