summaryrefslogtreecommitdiff
path: root/benchmarks
diff options
context:
space:
mode:
authorEric Wieser <wieser.eric@gmail.com>2017-08-01 20:29:36 +0000
committerCharles Harris <charlesr.harris@gmail.com>2017-08-05 10:36:48 -0600
commit2b781f8967488dc007f8f0a1e6a7f49208788d12 (patch)
tree88ad7478e033ce5980a365a479e22b78ba1cecaa /benchmarks
parent5ab02b15de72fa00d785f49c62466fe048264cc4 (diff)
downloadnumpy-2b781f8967488dc007f8f0a1e6a7f49208788d12.tar.gz
MAINT/DOC: Use builtin when np.{x} is builtins.{x}.
This is the case for x in {int, bool, str, float, complex, object}. Using the np.{x} version is deceptive as it suggests that there is a difference. This change doesn't affect any external behaviour. The `long` type is missing in python 3, so np.long is still useful
Diffstat (limited to 'benchmarks')
-rw-r--r--benchmarks/benchmarks/bench_core.py2
-rw-r--r--benchmarks/benchmarks/bench_reduce.py4
-rw-r--r--benchmarks/benchmarks/bench_ufunc.py2
3 files changed, 4 insertions, 4 deletions
diff --git a/benchmarks/benchmarks/bench_core.py b/benchmarks/benchmarks/bench_core.py
index a0de81054..26cffcab1 100644
--- a/benchmarks/benchmarks/bench_core.py
+++ b/benchmarks/benchmarks/bench_core.py
@@ -139,7 +139,7 @@ class CountNonzero(Benchmark):
class PackBits(Benchmark):
param_names = ['dtype']
- params = [[np.bool, np.uintp]]
+ params = [[bool, np.uintp]]
def setup(self, dtype):
self.d = np.ones(10000, dtype=dtype)
self.d2 = np.ones((200, 1000), dtype=dtype)
diff --git a/benchmarks/benchmarks/bench_reduce.py b/benchmarks/benchmarks/bench_reduce.py
index 704023528..353eb980c 100644
--- a/benchmarks/benchmarks/bench_reduce.py
+++ b/benchmarks/benchmarks/bench_reduce.py
@@ -29,8 +29,8 @@ class AddReduceSeparate(Benchmark):
class AnyAll(Benchmark):
def setup(self):
- self.zeros = np.zeros(100000, np.bool)
- self.ones = np.ones(100000, np.bool)
+ self.zeros = np.zeros(100000, bool)
+ self.ones = np.ones(100000, bool)
def time_all_fast(self):
self.zeros.all()
diff --git a/benchmarks/benchmarks/bench_ufunc.py b/benchmarks/benchmarks/bench_ufunc.py
index 1baee1340..8f7d638b5 100644
--- a/benchmarks/benchmarks/bench_ufunc.py
+++ b/benchmarks/benchmarks/bench_ufunc.py
@@ -62,7 +62,7 @@ class UFunc(Benchmark):
class Custom(Benchmark):
def setup(self):
- self.b = np.ones(20000, dtype=np.bool)
+ self.b = np.ones(20000, dtype=bool)
def time_nonzero(self):
np.nonzero(self.b)