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 May 6, 2024
1 parent c1caacc commit bc53325
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions pyxsim/tests/test_sloshing.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,23 @@ def test_sloshing(answer_store):
merge_files(["photons1.h5", "photons2.h5"], "photons.h5", overwrite=True)
merge_files(["events1.h5", "events2.h5"], "events.h5", overwrite=True)

with h5py.File("photons.h5", "r") as f, h5py.File(
"photons1.h5", "r"
) as f1, h5py.File("photons2.h5", "r") as f2:
with (
h5py.File("photons.h5", "r") as f,
h5py.File("photons1.h5", "r") as f1,
h5py.File("photons2.h5", "r") as f2,
):
assert f["data"]["energy"].size == n_photons1 + n_photons2
assert f["data"]["x"].size == n_cells1 + n_cells2
for k in f["data"]:
assert_array_equal(
f["data"][k][()], np.concatenate([f1["data"][k][()], f2["data"][k][()]])
)

with h5py.File("events.h5", "r") as f, h5py.File(
"events1.h5", "r"
) as f1, h5py.File("events2.h5", "r") as f2:
with (
h5py.File("events.h5", "r") as f,
h5py.File("events1.h5", "r") as f1,
h5py.File("events2.h5", "r") as f2,
):
assert f["data"]["eobs"].size == n_events1 + n_events2
for k in f["data"]:
assert_array_equal(
Expand Down

0 comments on commit bc53325

Please sign in to comment.