Skip to content

Commit

Permalink
added check for when an expected keyword is not populated
Browse files Browse the repository at this point in the history
  • Loading branch information
jrudz committed Mar 1, 2024
1 parent 4741354 commit 2d308d0
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 2d308d0

Please sign in to comment.