Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support numpy 2 in tests #997

Merged
merged 5 commits into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
2 changes: 1 addition & 1 deletion requirements/requirements-test-optional.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
h5py==3.11.0; implementation_name=='cpython'
numpy==1.26.4
numpy==2.0.0
pandas==2.2.2; implementation_name=='cpython'
tables==3.9.2; implementation_name=='cpython' and platform_machine != "arm64" or platform_system != "Darwin"
8 changes: 5 additions & 3 deletions tests/test_h5store.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
PANDAS_AND_TABLES = True
except ImportError:
PANDAS_AND_TABLES = False
except ValueError:
PANDAS_AND_TABLES = False

try:
import numpy # noqa
Expand Down Expand Up @@ -147,9 +149,9 @@ class TestH5Store(TestH5StoreBase):
valid_types.update(
{
"numpy_int_array": numpy.array([-1, 0, 1], dtype=numpy.int_),
"numpy_float_array": numpy.array([-1.5, 0, 1.5], dtype=numpy.float_),
"numpy_float_array": numpy.array([-1.5, 0, 1.5], dtype=numpy.float64),
"numpy_complex_array": numpy.array(
[-1.5 + 3.14j, 0, 1.5 - 5.67j], dtype=numpy.complex_
[-1.5 + 3.14j, 0, 1.5 - 5.67j], dtype=numpy.complex128
),
# Note that NumPy's string type is handled kind of like a char
# array or bytes, not like Python str. numpy.unicode_ uses a
Expand All @@ -159,7 +161,7 @@ class TestH5Store(TestH5StoreBase):
b"abcde",
b"\x73\x69\x67\x6E\x61\x63\x00\xF0\x9F\x8E\xA8",
],
dtype=numpy.string_,
dtype=numpy.bytes_,
),
"numpy_void_array": numpy.array(
[
Expand Down
Loading