Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions news/in-1-2-dependencies.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* ``h5py``, ``hdf5plugin`` and ``matplotlib`` as dependencies.

**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* <news item>

**Security:**

* <news item>
3 changes: 3 additions & 0 deletions requirements/conda.txt
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
numpy
h5py
hdf5plugin
matplotlib-base
3 changes: 3 additions & 0 deletions requirements/pip.txt
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
numpy
h5py
hdf5plugin
matplotlib
8 changes: 8 additions & 0 deletions src/diffpy/diffchooser/reader.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
"""Read EIGER2 NXmx runs.

Importing hdf5plugin registers the filters that h5py needs to read
bslz4-compressed frames.
"""

import h5py # noqa: F401

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we remove these noqa's?

import hdf5plugin # noqa: F401
19 changes: 19 additions & 0 deletions tests/test_reader.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"""Unit tests for reader.py."""

import h5py
import hdf5plugin
import numpy as np

from diffpy.diffchooser import reader # noqa


def test_read_bslz4_frame(tmp_path):
expected = np.arange(64, dtype=np.uint32).reshape(8, 8)
path = tmp_path / "frame.h5"
with h5py.File(path, "w") as f:
f.create_dataset(
"data", data=expected, **hdf5plugin.Bitshuffle(cname="lz4")
)
with h5py.File(path, "r") as f:
actual = f["data"][()]
np.testing.assert_array_equal(actual, expected)
Loading