Skip to content

Commit

Permalink
Reduce array size in Python test to speed it up.
Browse files Browse the repository at this point in the history
  • Loading branch information
akeley98 committed Jun 5, 2017
1 parent 65fb7d7 commit 2de6481
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/python_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,15 +441,21 @@ def test_clipped_median(shape1D, shape2D, combine_count, dtype, sigma_data):
compare_2D(arrays2D, actual, expected)

def main():
print """
\x1b[32m\x1b[1mNOTE:\x1b[0m
These tests are not representative of the speed of the mediocre library
(implemented in C). The library's results are being compared to results
calculated using pure Python. Calculating these Python results takes up
almost all of the testing time.\n"""
global seed, rand
while 1:
seed = hash(os.urandom(8))
rand = random.Random(seed)

print "Seed = ", seed

shape1D = (rand.randrange(600000, 800000),)
shape2D = (rand.randrange(200, 300), rand.randrange(200, 300))
shape1D = (rand.randrange(40000, 70000),)
shape2D = (rand.randrange(180, 240), rand.randrange(200, 300))
combine_count = rand.randrange(8, 24)
dtype = rand.choice((
None,None,None,None,None,None,None,None,None,None,
Expand Down

0 comments on commit 2de6481

Please sign in to comment.