Skip to content

Commit c3a7d01

Browse files
authored
Merge pull request #70 from histogrammar/numpy23_number_patch
numpy23 np.number patch
2 parents 642d89d + e7c4ac0 commit c3a7d01

File tree

6 files changed

+14
-10
lines changed

6 files changed

+14
-10
lines changed

CHANGES.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
Release notes
33
=============
44

5+
Version 1.1.1, Aug 2024
6+
-----------------------
7+
* Compatibility with numpy v2.3: converting np.number to a dtype no longer allowed.
8+
59
Version 1.1.0, Dec 2024
610
-----------------------
711
* Removed all ROOT, cpp and cuda code, it was no longer supported.

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ more quickly via Numpy commands, rather than Python for loops.
1717

1818
This Python implementation of histogrammar been tested to guarantee compatibility with its Scala implementation.
1919

20-
Latest Python release: v1.1.0 (Feb 2025).
21-
Latest update: Feb 2025.
20+
Latest Python release: v1.1.1 (Aug 2025).
21+
Latest update: Aug 2025.
2222

2323
References
2424
==========

histogrammar/util.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -533,8 +533,8 @@ def get_datatype(hist, itr=0):
533533
return []
534534
if isinstance(hist, histogrammar.Bag):
535535
if hist.dimension > 0:
536-
return [np.number] * hist.dimension
537-
return [str] if hist.range == "S" else [np.number]
536+
return [float] * hist.dimension
537+
return [str] if hist.range == "S" else [float]
538538
if isinstance(
539539
hist,
540540
(
@@ -550,7 +550,7 @@ def get_datatype(hist, itr=0):
550550
return []
551551
# else: no parent histogram.
552552
# input datatype must be a number. Let's also make an educated guess if it's a converted timestamp
553-
datatype = [np.number]
553+
datatype = [float]
554554
if isinstance(hist, histogrammar.Maximize):
555555
value = hist.max
556556
elif isinstance(hist, histogrammar.Minimize):
@@ -582,7 +582,7 @@ def get_datatype(hist, itr=0):
582582
else:
583583
# input datatype must be a number.
584584
# let's make an educated guess if it's a converted timestamp
585-
datatype = [np.number]
585+
datatype = [float]
586586
if isinstance(hist, (histogrammar.Bin, histogrammar.SparselyBin)):
587587
values = [hist.low, hist.high]
588588
elif isinstance(hist, histogrammar.CentrallyBin):

histogrammar/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import re
44

5-
version = "1.1.0"
5+
version = "1.1.1"
66

77

88
def split_version_string(version_string: str) -> tuple[int, int]:

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ pandas = [
4040
"pandas"
4141
]
4242
spark = [
43-
"pyspark>=3.1; python_version <= '3.11'",
43+
"pyspark<4; python_version <= '3.11'",
4444
]
4545
test = [
4646
"ipykernel>=5.1.3",

tests/test_numpy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1111,8 +1111,8 @@ def test_datatype(self):
11111111
df, hist1, hist2, hist3 = get_test_histograms1()
11121112

11131113
assert hist1.datatype == str
1114-
np.testing.assert_array_equal(hist2.datatype, [np.number, str])
1115-
np.testing.assert_array_equal(hist3.datatype, [np.datetime64, np.number, str])
1114+
np.testing.assert_array_equal(hist2.datatype, [float, str])
1115+
np.testing.assert_array_equal(hist3.datatype, [np.datetime64, float, str])
11161116

11171117
def test_n_bins(self):
11181118
"""Test getting the number of allocated bins"""

0 commit comments

Comments
 (0)