(self, index_structure, dtype, method)
| 22 | param_names = ["index_structure", "dtype", "method"] |
| 23 | |
| 24 | def setup(self, index_structure, dtype, method): |
| 25 | N = 10**5 |
| 26 | dates_left = date_range("1/1/2000", periods=N, freq="min") |
| 27 | fmt = "%Y-%m-%d %H:%M:%S" |
| 28 | date_str_left = Index(dates_left.strftime(fmt)) |
| 29 | int_left = Index(np.arange(N)) |
| 30 | ea_int_left = Index(np.arange(N), dtype="Int64") |
| 31 | str_left = Index([f"i-{i}" for i in range(N)], dtype=object) |
| 32 | |
| 33 | data = { |
| 34 | "datetime": dates_left, |
| 35 | "date_string": date_str_left, |
| 36 | "int": int_left, |
| 37 | "strings": str_left, |
| 38 | "ea_int": ea_int_left, |
| 39 | } |
| 40 | |
| 41 | if index_structure == "non_monotonic": |
| 42 | data = {k: mi[::-1] for k, mi in data.items()} |
| 43 | |
| 44 | data = {k: {"left": idx, "right": idx[:-1]} for k, idx in data.items()} |
| 45 | |
| 46 | self.left = data[dtype]["left"] |
| 47 | self.right = data[dtype]["right"] |
| 48 | |
| 49 | def time_operation(self, index_structure, dtype, method): |
| 50 | getattr(self.left, method)(self.right) |
nothing calls this directly
no test coverage detected