From 7ac2ac12065343fd3cb04a603e55101df753f3b3 Mon Sep 17 00:00:00 2001 From: Matthew Roeschke <10647082+mroeschke@users.noreply.github.com> Date: Wed, 23 Nov 2022 11:41:17 -0800 Subject: [PATCH] CI/BENCH: Make CategoricalIndexIndexing benchmark less flaky --- asv_bench/benchmarks/indexing.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/asv_bench/benchmarks/indexing.py b/asv_bench/benchmarks/indexing.py index 3efc39c7e1efe..1c9da3f1ed9df 100644 --- a/asv_bench/benchmarks/indexing.py +++ b/asv_bench/benchmarks/indexing.py @@ -3,8 +3,6 @@ lower-level methods directly on Index and subclasses, see index_object.py, indexing_engine.py, and index_cached.py """ -import itertools -import string import warnings import numpy as np @@ -353,15 +351,13 @@ def setup(self, index): "non_monotonic": CategoricalIndex(list("abc" * N)), } self.data = indices[index] - self.data_unique = CategoricalIndex( - ["".join(perm) for perm in itertools.permutations(string.printable, 3)] - ) + self.data_unique = CategoricalIndex([str(i) for i in range(N * 3)]) self.int_scalar = 10000 self.int_list = list(range(10000)) self.cat_scalar = "b" - self.cat_list = ["a", "c"] + self.cat_list = ["1", "3"] def time_getitem_scalar(self, index): self.data[self.int_scalar]