Skip to content

Commit

Permalink
Closes #3798: benchmark_v2/sort_cases_benchmark.py throws errors (#3801)
Browse files Browse the repository at this point in the history
Co-authored-by: Amanda Potts <[email protected]>
  • Loading branch information
ajpotts and ajpotts authored Sep 30, 2024
1 parent 28bf2a9 commit 66e26a8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
2 changes: 1 addition & 1 deletion benchmark.ini
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ testpaths =
benchmark_v2/substring_search_benchmark.py
benchmark_v2/no_op_benchmark.py
benchmark_v2/io_benchmark.py
#! benchmark_v2/sort_cases_benchmark.py
benchmark_v2/sort_cases_benchmark.py
python_functions = bench_*
env =
D:ARKOUDA_SERVER_HOST=localhost
Expand Down
13 changes: 4 additions & 9 deletions benchmark_v2/sort_cases_benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
from arkouda.sorting import SortingAlgorithm

TYPES = ("int64", "float64")
POWERLAW_DATA = None


def get_nbytes(data):
Expand Down Expand Up @@ -63,15 +62,11 @@ def bench_random_uniform(benchmark, algo, dtype, bits):


def _generate_power_law_data():
global POWERLAW_DATA
y = ak.uniform(pytest.prob_size)
a = -2.5 # power law exponent, between -2 and -3
ub = 2**32 # upper bound

if POWERLAW_DATA is None:
y = ak.uniform(pytest.prob_size)
a = -2.5 # power law exponent, between -2 and -3
ub = 2 ** 32 # upper bound
POWERLAW_DATA = ((ub ** (a + 1) - 1) * y + 1) ** (1 / (a + 1))

return POWERLAW_DATA
return ((ub ** (a + 1) - 1) * y + 1) ** (1 / (a + 1))


@pytest.mark.benchmark(group="AK_Sort_Cases")
Expand Down

0 comments on commit 66e26a8

Please sign in to comment.