-
Notifications
You must be signed in to change notification settings - Fork 520
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
Numpy 2.x incompatibilities #2348
Comments
From 48e0d4ca462b60fcd89e795c77d7e4056921f9b4 Mon Sep 17 00:00:00 2001
From: Thomas A Caswell <tcaswell@bnl.gov>
Date: Thu, 23 Nov 2023 16:04:35 -0500
Subject: [PATCH] MNT: account for changes to complex types in numpy2
---
h5py/api_compat.h | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/h5py/api_compat.h b/h5py/api_compat.h
index 52917f4d..ded997ec 100644
--- a/h5py/api_compat.h
+++ b/h5py/api_compat.h
@@ -35,14 +35,14 @@ typedef void *PyMPI_MPI_Message;
#define h5py_size_n256 (sizeof(npy_complex256))
#endif
-#define h5py_offset_n64_real (HOFFSET(npy_complex64, real))
-#define h5py_offset_n64_imag (HOFFSET(npy_complex64, imag))
-#define h5py_offset_n128_real (HOFFSET(npy_complex128, real))
-#define h5py_offset_n128_imag (HOFFSET(npy_complex128, imag))
+#define h5py_offset_n64_real 0
+#define h5py_offset_n64_imag h5py_size_n64 / 2
+#define h5py_offset_n128_real 0
+#define h5py_offset_n128_imag h5py_size_n128 / 2
#ifdef NPY_COMPLEX256
-#define h5py_offset_n256_real (HOFFSET(npy_complex256, real))
-#define h5py_offset_n256_imag (HOFFSET(npy_complex256, imag))
+#define h5py_offset_n256_real 0
+#define h5py_offset_n256_imag h5py_size_n256 / 2
#endif
#endif
--
2.42.1 I have been carrying this patch locally, but I am pretty sure it is not the correct fix. |
This should be fixed now in #2345. In the numpy issue it was suggested to use |
I think this was closed by #2345 as well. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See #2345 where I discovered when building against numpy 2.0 that there were some compilation errors. Primarily:
This is caused by numpy's complex types no longer being structs, but regular float/double types now:
numpy/numpy#24085
This h5py usage is here:
h5py/h5py/api_compat.h
Lines 38 to 41 in de331ae
I'm mostly making this issue for record keeping, but also to link numpy maintainers to for help.
The text was updated successfully, but these errors were encountered: