Skip to content

Commit af152e1

Browse files
committed
fix: remove numpy warnings
1 parent 5743d5d commit af152e1

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

histogrammar/primitives/centrallybin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -703,8 +703,8 @@ def _numpy(self, data, weights, shape):
703703
v.fill(None, float(hi))
704704

705705
else:
706-
selection = numpy.empty(q.shape, dtype=numpy.bool)
707-
selection2 = numpy.empty(q.shape, dtype=numpy.bool)
706+
selection = numpy.empty(q.shape, dtype=bool)
707+
selection2 = numpy.empty(q.shape, dtype=bool)
708708

709709
for index in xrange(len(self.bins)):
710710
if index == 0:

histogrammar/primitives/irregularlybin.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -648,8 +648,8 @@ def _numpy(self, data, weights, shape):
648648

649649
# FIXME: the case of all Counts could be optimized with numpy.histogram (see CentrallyBin for an example)
650650

651-
selection = numpy.empty(q.shape, dtype=numpy.bool)
652-
selection2 = numpy.empty(q.shape, dtype=numpy.bool)
651+
selection = numpy.empty(q.shape, dtype=bool)
652+
selection2 = numpy.empty(q.shape, dtype=bool)
653653
subweights = weights.copy()
654654
for (low, sub), (high, _) in zip(self.bins, self.bins[1:] + ((float("nan"), None),)):
655655
numpy.greater_equal(q, low, selection)

histogrammar/primitives/stack.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@ def _numpy(self, data, weights, shape):
527527
weights = weights.copy()
528528
weights[selection] = 0.0
529529

530-
selection = numpy.empty(q.shape, dtype=numpy.bool)
530+
selection = numpy.empty(q.shape, dtype=bool)
531531
for threshold, sub in self.bins:
532532
numpy.less(q, threshold, selection)
533533
subweights[:] = weights

0 commit comments

Comments
 (0)