Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Sep 19, 2024
1 parent ef21a6f commit bc28f26
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions znh5md/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,15 +161,19 @@ def _extract_additional_data(self, f, index, arrays_data, calc_data, info_data):
or key == "force"
):
try:
calc_data[key if key != "force" else "forces"] = fmt.get_property(
f["particles"], self.particle_group, key, index
calc_data[key if key != "force" else "forces"] = (
fmt.get_property(
f["particles"], self.particle_group, key, index
)
)
except IndexError:
pass
pass
else:
try:
arrays_data[key if key != "force" else "forces"] = fmt.get_property(
f["particles"], self.particle_group, key, index
arrays_data[key if key != "force" else "forces"] = (
fmt.get_property(
f["particles"], self.particle_group, key, index
)
)
except IndexError:
pass
Expand All @@ -195,9 +199,9 @@ def _extract_additional_data(self, f, index, arrays_data, calc_data, info_data):
)

if (
f["observables"][self.particle_group][key]["value"].attrs.get(
"ZNH5MD_TYPE"
)
f["observables"][self.particle_group][key][
"value"
].attrs.get("ZNH5MD_TYPE")
== "json"
):
info_data[key] = [json.loads(x) for x in data]
Expand Down

0 comments on commit bc28f26

Please sign in to comment.