Skip to content

Commit

Permalink
small cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
dcherian committed Oct 11, 2023
1 parent 225518c commit fcf282a
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions asv_bench/benchmarks/reduce.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
engines = ["flox", "numpy", "numbagg"]
expected_groups = {
"None": None,
# "RangeIndex": pd.RangeIndex(5),
"bins": pd.IntervalIndex.from_breaks([1, 2, 4]),
}
expected_names = tuple(expected_groups)
Expand Down Expand Up @@ -95,14 +94,6 @@ def time_reduce_bare(self, func, engine):
)


# class ChunkReduce1DUnsorted(ChunkReduce):
# def setup(self, *args, **kwargs):
# self.array = np.ones((N,))
# self.labels = np.random.permutation(np.repeat(np.arange(5), repeats=N // 5))
# self.axis = -1
# setup_jit()


class ChunkReduce2D(ChunkReduce):
def setup(self, *args, **kwargs):
self.array = np.ones((N, N))
Expand All @@ -111,20 +102,27 @@ def setup(self, *args, **kwargs):
setup_jit()


class ChunkReduce2DAllAxes(ChunkReduce):
def setup(self, *args, **kwargs):
self.array = np.ones((N, N))
self.labels = np.repeat(np.arange(N // 5), repeats=5)
self.axis = None
setup_jit()


# class ChunkReduce2DUnsorted(ChunkReduce):
# def setup(self, *args, **kwargs):
# self.array = np.ones((N, N))
# self.labels = np.random.permutation(np.repeat(np.arange(N // 5), repeats=5))
# self.axis = -1
# setup_jit()


class ChunkReduce2DAllAxes(ChunkReduce):
def setup(self, *args, **kwargs):
self.array = np.ones((N, N))
self.labels = np.repeat(np.arange(N // 5), repeats=5)
self.axis = None
setup_jit()
# class ChunkReduce1DUnsorted(ChunkReduce):
# def setup(self, *args, **kwargs):
# self.array = np.ones((N,))
# self.labels = np.random.permutation(np.repeat(np.arange(5), repeats=N // 5))
# self.axis = -1
# setup_jit()


# class ChunkReduce2DAllAxesUnsorted(ChunkReduce):
Expand Down

0 comments on commit fcf282a

Please sign in to comment.