From 6fd19bcf0359dd47708e95c520e47edf1d25359e Mon Sep 17 00:00:00 2001 From: Matt Roeschke Date: Mon, 14 Dec 2020 14:10:03 -0800 Subject: [PATCH 1/2] BENCH: Fix CategoricalIndexing benchmark --- asv_bench/benchmarks/indexing.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/asv_bench/benchmarks/indexing.py b/asv_bench/benchmarks/indexing.py index 4fd91c8aafe4b..38d1f64bd5f4e 100644 --- a/asv_bench/benchmarks/indexing.py +++ b/asv_bench/benchmarks/indexing.py @@ -3,6 +3,7 @@ lower-level methods directly on Index and subclasses, see index_object.py, indexing_engine.py, and index_cached.py """ +import string import warnings import numpy as np @@ -255,6 +256,7 @@ def setup(self, index): "non_monotonic": CategoricalIndex(list("abc" * N)), } self.data = indices[index] + self.data_unique = CategoricalIndex(list(string.printable)) self.int_scalar = 10000 self.int_list = list(range(10000)) @@ -281,7 +283,7 @@ def time_get_loc_scalar(self, index): self.data.get_loc(self.cat_scalar) def time_get_indexer_list(self, index): - self.data.get_indexer(self.cat_list) + self.data_unique.get_indexer(self.cat_list) class MethodLookup: From 6c0c23008cdcade84b91117246e2003b81c23812 Mon Sep 17 00:00:00 2001 From: Matt Roeschke Date: Mon, 14 Dec 2020 14:11:16 -0800 Subject: [PATCH 2/2] Try always running benchmarks --- .github/workflows/ci.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2848437a76a16..ee93c84f18801 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -74,14 +74,10 @@ jobs: asv check -E existing git remote add upstream https://github.com/pandas-dev/pandas.git git fetch upstream - if git diff upstream/master --name-only | grep -q "^asv_bench/"; then - asv machine --yes - asv dev | sed "/failed$/ s/^/##[error]/" | tee benchmarks.log - if grep "failed" benchmarks.log > /dev/null ; then - exit 1 - fi - else - echo "Benchmarks did not run, no changes detected" + asv machine --yes + asv dev | sed "/failed$/ s/^/##[error]/" | tee benchmarks.log + if grep "failed" benchmarks.log > /dev/null ; then + exit 1 fi if: always()