diff options
| author | Matti Picus <matti.picus@gmail.com> | 2022-12-04 21:26:06 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-04 21:26:06 -0500 |
| commit | bc88c024edcc6dccc478748006e7650a61829331 (patch) | |
| tree | 54aa8debeb897a1d28763c1969bc98f4aad0fc0a | |
| parent | 00ddbb9b6ddd5fbe4a69df69f6314d4192ec8848 (diff) | |
| parent | 7c24bd4c36c2793238305f3043c7a71cd89c455f (diff) | |
| download | numpy-bc88c024edcc6dccc478748006e7650a61829331.tar.gz | |
Merge pull request #22726 from HaoZeke/benchMA
BENCH: Add a test for masked array creations
| -rw-r--r-- | benchmarks/benchmarks/bench_ma.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/benchmarks/benchmarks/bench_ma.py b/benchmarks/benchmarks/bench_ma.py index b214c0b86..0247065a7 100644 --- a/benchmarks/benchmarks/bench_ma.py +++ b/benchmarks/benchmarks/bench_ma.py @@ -17,6 +17,14 @@ class MA(Benchmark): def time_masked_array_l100_t100(self): np.ma.masked_array(self.l100, self.t100) +class MACreation(Benchmark): + param_names = ['data', 'mask'] + params = [[10, 100, 1000], + [True, False, None]] + + def time_ma_creations(self, data, mask): + np.ma.array(data=np.zeros(int(data)), mask=mask) + class Indexing(Benchmark): param_names = ['masked', 'ndim', 'size'] |
