From 348ac6e0ecd6a19161a4ca790cf5cf76b28aa95f Mon Sep 17 00:00:00 2001 From: Divyajyoti <50514405+divyajyoti09@users.noreply.github.com> Date: Sun, 24 Nov 2024 17:24:55 +0000 Subject: [PATCH 1/4] Update core.py to fix numpy ComplexWarning numpy has deprecated ComplexWarning hence fixing it to `numpy.exceptions.ComplexWarning` --- deepdish/core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deepdish/core.py b/deepdish/core.py index 3782a21..d242bc8 100644 --- a/deepdish/core.py +++ b/deepdish/core.py @@ -5,7 +5,7 @@ import itertools as itr import sys from contextlib import contextmanager -warnings.simplefilter("ignore", np.ComplexWarning) +warnings.simplefilter("ignore", np.exceptions.ComplexWarning) _is_verbose = False _is_silent = False From 563af86e189bd1149c5be00336d862341f5a40f6 Mon Sep 17 00:00:00 2001 From: Divyajyoti <50514405+divyajyoti09@users.noreply.github.com> Date: Sun, 24 Nov 2024 18:08:11 +0000 Subject: [PATCH 2/4] Update hdf5io.py to be compatible with new numpy versions ``` AttributeError: `np.unicode_` was removed in the NumPy 2.0 release. Use `np.str_` instead. ``` --- deepdish/io/hdf5io.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deepdish/io/hdf5io.py b/deepdish/io/hdf5io.py index 372ee7b..2d8c540 100644 --- a/deepdish/io/hdf5io.py +++ b/deepdish/io/hdf5io.py @@ -112,7 +112,7 @@ def _get_compression_filters(compression='default'): def _save_ndarray(handler, group, name, x, filters=None): - if np.issubdtype(x.dtype, np.unicode_): + if np.issubdtype(x.dtype, np.str_): # Convert unicode strings to pure byte arrays strtype = b'unicode' itemsize = x.itemsize // 4 From 5e1eb583836157bd6a149b2566d06d05ade0c746 Mon Sep 17 00:00:00 2001 From: Divyajyoti Date: Sun, 24 Nov 2024 18:14:49 +0000 Subject: [PATCH 3/4] including .egg-info/ --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 8ea3204..542467b 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,7 @@ build *.pyc *.c *.so +*.egg-info/ # OS or Editor folders .DS_Store From f543786241fcb0137af002ecd9b7c6f1557935a4 Mon Sep 17 00:00:00 2001 From: Divyajyoti Date: Sun, 24 Nov 2024 18:15:41 +0000 Subject: [PATCH 4/4] Update hdf5io.py to be compatible with latest version of numpy --- deepdish/io/hdf5io.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deepdish/io/hdf5io.py b/deepdish/io/hdf5io.py index 2d8c540..ac4712e 100644 --- a/deepdish/io/hdf5io.py +++ b/deepdish/io/hdf5io.py @@ -118,7 +118,7 @@ def _save_ndarray(handler, group, name, x, filters=None): itemsize = x.itemsize // 4 atom = tables.UInt8Atom() x = x.view(dtype=np.uint8) - elif np.issubdtype(x.dtype, np.string_): + elif np.issubdtype(x.dtype, np.bytes_): strtype = b'ascii' itemsize = x.itemsize atom = tables.StringAtom(itemsize)