Skip to content

Commit

Permalink
Merge pull request #97 from nomad-coe/96-error-with-h5md-upload
Browse files Browse the repository at this point in the history
added check for when an expected keyword is not populated
  • Loading branch information
JFRudzinski authored Mar 1, 2024
2 parents 4741354 + 2d308d0 commit 4c72469
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions atomisticparsers/h5md/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,14 +300,17 @@ def get_value(value, steps, path=""):
path = f"{self._path_group_particles_all}.box.{self._nomad_to_box_group_map[box_key]}"
value = self._data_parser.get(path)
values_dict["system"][box_key] = get_value(value, steps, path=path)

# populate the dictionary
for i_step, step in enumerate(steps):
self._system_info["system"][step] = {
key: val[i_step] for key, val in values_dict["system"].items()
key: val[i_step]
for key, val in values_dict["system"].items()
if val is not None
}
self._system_info["calculation"][step] = {
key: val[i_step] for key, val in values_dict["calculation"].items()
key: val[i_step]
for key, val in values_dict["calculation"].items()
if val is not None
}

def parse_observable_info(self):
Expand Down

0 comments on commit 4c72469

Please sign in to comment.