| 118 | ] |
| 119 | |
| 120 | def setup(self, constructor, dtype, window_kwargs, function, parallel, cols): |
| 121 | N = 10**3 |
| 122 | window, kwargs = window_kwargs |
| 123 | shape = (N, cols) if cols is not None and constructor != "Series" else N |
| 124 | arr = (100 * np.random.random(shape)).astype(dtype) |
| 125 | data = getattr(pd, constructor)(arr) |
| 126 | |
| 127 | # Warm the cache |
| 128 | with warnings.catch_warnings(record=True): |
| 129 | # Catch parallel=True not being applicable e.g. 1D data |
| 130 | self.window = getattr(data, window)(**kwargs) |
| 131 | self.window.apply( |
| 132 | function, raw=True, engine="numba", engine_kwargs={"parallel": parallel} |
| 133 | ) |
| 134 | |
| 135 | def test_method(self, constructor, dtype, window_kwargs, function, parallel, cols): |
| 136 | with warnings.catch_warnings(record=True): |