Skip to content

Commit 36d5de7

Browse files
committed
Fix lint errors
1 parent ecff7b7 commit 36d5de7

1 file changed

Lines changed: 10 additions & 13 deletions

File tree

lib/node_modules/@stdlib/math/base/special/erfinv/benchmark/python/benchmark.scipy.py

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
#!/usr/bin/env python
22
"""Benchmark scipy.special.erfinv."""
33

4+
from __future__ import print_function
45
import timeit
56

6-
name = "erfinv"
7-
repeats = 3
8-
iterations = 1000000
7+
NAME = "erfinv"
8+
REPEATS = 3
9+
ITERATIONS = 1000000
910

1011

1112
def print_version():
1213
"""Print the TAP version."""
13-
1414
print("TAP version 13")
1515

1616

@@ -23,7 +23,6 @@ def print_summary(total, passing):
2323
* `passing`: number of passing tests
2424
2525
"""
26-
2726
print("#")
2827
print("1.." + str(total)) # TAP plan
2928
print("# total " + str(total))
@@ -45,33 +44,31 @@ def print_results(elapsed):
4544
python> print_results(0.131009101868)
4645
```
4746
"""
48-
49-
rate = iterations / elapsed
47+
rate = ITERATIONS / elapsed
5048

5149
print(" ---")
52-
print(" iterations: " + str(iterations))
50+
print(" iterations: " + str(ITERATIONS))
5351
print(" elapsed: " + str(elapsed))
5452
print(" rate: " + str(rate))
5553
print(" ...")
5654

5755

5856
def benchmark():
5957
"""Run the benchmark and print benchmark results."""
60-
6158
setup = "from scipy.special import erfinv; from random import random;"
6259
stmt = "y = erfinv(2.0*random() - 1.0)"
6360

6461
t = timeit.Timer(stmt, setup=setup)
6562

6663
print_version()
6764

68-
for i in xrange(repeats):
69-
print("# python::" + name)
70-
elapsed = t.timeit(number=iterations)
65+
for i in xrange(REPEATS):
66+
print("# python::" + NAME)
67+
elapsed = t.timeit(number=ITERATIONS)
7168
print_results(elapsed)
7269
print("ok " + str(i+1) + " benchmark finished")
7370

74-
print_summary(repeats, repeats)
71+
print_summary(REPEATS, REPEATS)
7572

7673

7774
def main():

0 commit comments

Comments
 (0)