Skip to content

Commit fb4b030

Browse files
committed
add float32 cases to cwt benchmarks
1 parent 591dd8a commit fb4b030

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

benchmarks/benchmarks/cwt_benchmarks.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,22 @@ class CwtTimeSuiteBase(object):
99
params = ([32, 128, 512, 2048],
1010
['cmor', 'cgau4', 'fbsp', 'gaus4', 'mexh', 'morl', 'shan'],
1111
[16, 64, 256],
12-
['conv', 'fft'])
13-
param_names = ('n', 'wavelet', 'max_scale', 'method')
12+
[np.float32, np.float64],
13+
['conv', 'fft'],
14+
)
15+
param_names = ('n', 'wavelet', 'max_scale', 'dtype', 'method')
1416

15-
def setup(self, n, wavelet, max_scale, method):
17+
def setup(self, n, wavelet, max_scale, dtype, method):
1618
try:
1719
from pywt import cwt
1820
except ImportError:
1921
raise NotImplementedError("cwt not available")
20-
self.data = np.ones(n, dtype='float')
21-
self.scales = np.arange(1, max_scale+1)
22+
self.data = np.ones(n, dtype=dtype)
23+
self.scales = np.arange(1, max_scale + 1)
2224

2325

2426
class CwtTimeSuite(CwtTimeSuiteBase):
25-
def time_cwt(self, n, wavelet, max_scale, method):
27+
def time_cwt(self, n, wavelet, max_scale, dtype, method):
2628
try:
2729
pywt.cwt(self.data, self.scales, wavelet, method=method)
2830
except TypeError:

0 commit comments

Comments
 (0)