numpy 1.22.4 Pypi GitHub Homepage
Other Docs
NotesParametersReturnsBackRef
bench(self, label='fast', verbose=1, extra_argv=None)

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.

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.

Run benchmarks for module using nose.

Examples

This example is valid syntax, but we were not able to check execution
>>> success = np.lib.bench() #doctest: +SKIP
Running benchmarks for numpy.lib
...
using 562341 items:
unique:
0.11
unique1d:
0.11
ratio: 1.0
nUnique: 56230 == 56230
...
OK
This example is valid syntax, but we were not able to check execution
>>> success #doctest: +SKIP
True
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

numpy.testing._private.nosetester.NoseTester.bench

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /numpy/testing/_private/nosetester.py#465
type: <class 'function'>
Commit: