Skip to content

Commit

Permalink
Merge pull request #63 from jzuhone/pre-commit-ci-update-config
Browse files Browse the repository at this point in the history
[pre-commit.ci] pre-commit autoupdate
  • Loading branch information
jzuhone authored May 31, 2024
2 parents 1d8fe02 + bc53325 commit c90f7c6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ ci:

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- repo: https://github.com/psf/black
rev: 24.1.1
rev: 24.4.2
hooks:
- id: black-jupyter

Expand Down
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 c90f7c6

Please sign in to comment.