Skip to content

Commit fc0f010

Browse files
authored
Use native bool type in arrays instead of deprecated np.bool (#236)
1 parent 74791f9 commit fc0f010

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

tests/reductions/logical_ops.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class Test(Chare):
99

1010
def doallfalse(self, f1, f2, f3, array=False):
1111
if array:
12-
data = np.zeros(ARRAY_SIZE, dtype=np.bool)
12+
data = np.zeros(ARRAY_SIZE, dtype=bool)
1313
else:
1414
data = False
1515
self.reduce(f1, data, Reducer.logical_and)
@@ -18,7 +18,7 @@ def doallfalse(self, f1, f2, f3, array=False):
1818

1919
def doalltrue(self, f1, f2, f3, array=False):
2020
if array:
21-
data = np.ones(ARRAY_SIZE, dtype=np.bool)
21+
data = np.ones(ARRAY_SIZE, dtype=bool)
2222
else:
2323
data = True
2424
self.reduce(f1, data, Reducer.logical_and)
@@ -43,9 +43,9 @@ def main(args):
4343

4444
f1, f2, f3 = Future(), Future(), Future()
4545
g.doallfalse(f1, f2, f3, array=True)
46-
np.testing.assert_array_equal(f1.get(), np.zeros(ARRAY_SIZE, dtype=np.bool))
47-
np.testing.assert_array_equal(f2.get(), np.zeros(ARRAY_SIZE, dtype=np.bool))
48-
np.testing.assert_array_equal(f3.get(), np.zeros(ARRAY_SIZE, dtype=np.bool))
46+
np.testing.assert_array_equal(f1.get(), np.zeros(ARRAY_SIZE, dtype=bool))
47+
np.testing.assert_array_equal(f2.get(), np.zeros(ARRAY_SIZE, dtype=bool))
48+
np.testing.assert_array_equal(f3.get(), np.zeros(ARRAY_SIZE, dtype=bool))
4949

5050
f1, f2, f3 = Future(), Future(), Future()
5151
g.doalltrue(f1, f2, f3, array=False)
@@ -55,9 +55,9 @@ def main(args):
5555

5656
f1, f2, f3 = Future(), Future(), Future()
5757
g.doalltrue(f1, f2, f3, array=True)
58-
np.testing.assert_array_equal(f1.get(), np.ones(ARRAY_SIZE, dtype=np.bool))
59-
np.testing.assert_array_equal(f2.get(), np.ones(ARRAY_SIZE, dtype=np.bool))
60-
np.testing.assert_array_equal(f3.get(), np.zeros(ARRAY_SIZE, dtype=np.bool))
58+
np.testing.assert_array_equal(f1.get(), np.ones(ARRAY_SIZE, dtype=bool))
59+
np.testing.assert_array_equal(f2.get(), np.ones(ARRAY_SIZE, dtype=bool))
60+
np.testing.assert_array_equal(f3.get(), np.zeros(ARRAY_SIZE, dtype=bool))
6161

6262
f1, f2, f3 = Future(), Future(), Future()
6363
g.test1(f1, f2, f3)

0 commit comments

Comments
 (0)