diff --git a/CHANGES.rst b/CHANGES.rst index 39fda8f..fc01b45 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -2,6 +2,10 @@ Release notes ============= +Version 1.1.1, Aug 2024 +----------------------- +* Compatibility with numpy v2.3: converting np.number to a dtype no longer allowed. + Version 1.1.0, Dec 2024 ----------------------- * Removed all ROOT, cpp and cuda code, it was no longer supported. diff --git a/README.rst b/README.rst index 3f52ceb..f65a832 100644 --- a/README.rst +++ b/README.rst @@ -17,8 +17,8 @@ more quickly via Numpy commands, rather than Python for loops. This Python implementation of histogrammar been tested to guarantee compatibility with its Scala implementation. -Latest Python release: v1.1.0 (Feb 2025). -Latest update: Feb 2025. +Latest Python release: v1.1.1 (Aug 2025). +Latest update: Aug 2025. References ========== diff --git a/histogrammar/util.py b/histogrammar/util.py index d13c7ad..25987eb 100644 --- a/histogrammar/util.py +++ b/histogrammar/util.py @@ -533,8 +533,8 @@ def get_datatype(hist, itr=0): return [] if isinstance(hist, histogrammar.Bag): if hist.dimension > 0: - return [np.number] * hist.dimension - return [str] if hist.range == "S" else [np.number] + return [float] * hist.dimension + return [str] if hist.range == "S" else [float] if isinstance( hist, ( @@ -550,7 +550,7 @@ def get_datatype(hist, itr=0): return [] # else: no parent histogram. # input datatype must be a number. Let's also make an educated guess if it's a converted timestamp - datatype = [np.number] + datatype = [float] if isinstance(hist, histogrammar.Maximize): value = hist.max elif isinstance(hist, histogrammar.Minimize): @@ -582,7 +582,7 @@ def get_datatype(hist, itr=0): else: # input datatype must be a number. # let's make an educated guess if it's a converted timestamp - datatype = [np.number] + datatype = [float] if isinstance(hist, (histogrammar.Bin, histogrammar.SparselyBin)): values = [hist.low, hist.high] elif isinstance(hist, histogrammar.CentrallyBin): diff --git a/histogrammar/version.py b/histogrammar/version.py index e0be64f..54c25e9 100644 --- a/histogrammar/version.py +++ b/histogrammar/version.py @@ -2,7 +2,7 @@ import re -version = "1.1.0" +version = "1.1.1" def split_version_string(version_string: str) -> tuple[int, int]: diff --git a/pyproject.toml b/pyproject.toml index dd0d4a2..97da278 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,7 +40,7 @@ pandas = [ "pandas" ] spark = [ - "pyspark>=3.1; python_version <= '3.11'", + "pyspark<4; python_version <= '3.11'", ] test = [ "ipykernel>=5.1.3", diff --git a/tests/test_numpy.py b/tests/test_numpy.py index 2bea87b..cb1fbc4 100644 --- a/tests/test_numpy.py +++ b/tests/test_numpy.py @@ -1111,8 +1111,8 @@ def test_datatype(self): df, hist1, hist2, hist3 = get_test_histograms1() assert hist1.datatype == str - np.testing.assert_array_equal(hist2.datatype, [np.number, str]) - np.testing.assert_array_equal(hist3.datatype, [np.datetime64, np.number, str]) + np.testing.assert_array_equal(hist2.datatype, [float, str]) + np.testing.assert_array_equal(hist3.datatype, [np.datetime64, float, str]) def test_n_bins(self): """Test getting the number of allocated bins"""