numpy.testing.Tester.benchΒΆ
-
Tester.
bench
(label='fast', verbose=1, extra_argv=None)[source]ΒΆ Run benchmarks for module using nose.
Parameters: - label : {βfastβ, βfullβ, ββ, attribute identifier}, optional
Identifies the benchmarks to run. This can be a string to pass to the nosetests executable with the β-Aβ option, or one of several special values. Special values are: * βfastβ - the default - which corresponds to the
nosetests -A
option of βnot slowβ.
- βfullβ - fast (as above) and slow benchmarks as in the βno -Aβ option to nosetests - this is the same as ββ.
- None or ββ - run all tests.
attribute_identifier - string passed directly to nosetests as β-Aβ.
- verbose : int, optional
Verbosity value for benchmark outputs, in the range 1-10. Default is 1.
- extra_argv : list, optional
List with any extra arguments to pass to nosetests.
Returns: - success : bool
Returns True if running the benchmarks works, False if an error occurred.
Notes
Benchmarks are like tests, but have names starting with βbenchβ instead of βtestβ, and can be found under the βbenchmarksβ sub-directory of the module.
Each NumPy module exposes
bench
in its namespace to run all benchmarks for it.Examples
>>> success = np.lib.bench() Running benchmarks for numpy.lib ... using 562341 items: unique: 0.11 unique1d: 0.11 ratio: 1.0 nUnique: 56230 == 56230 ... OK
>>> success True