Skip to content

CI/BENCH: Make CategoricalIndexIndexing benchmark less flaky #49870

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 26, 2022
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions asv_bench/benchmarks/indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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]
Expand Down