MCPcopy Create free account
hub / github.com/numpy/numpy / test_version

Function test_version

tools/openblas_support.py:326–346  ·  view source on GitHub ↗

Assert that expected OpenBLAS version is actually available via NumPy. Requires threadpoolctl

(expected_version=None)

Source from the content-addressed store, hash-verified

324
325
326def test_version(expected_version=None):
327 """
328 Assert that expected OpenBLAS version is
329 actually available via NumPy. Requires threadpoolctl
330 """
331 import numpy
332 import threadpoolctl
333
334 data = threadpoolctl.threadpool_info()
335 if len(data) != 1:
336 if platform.python_implementation() == 'PyPy':
337 print(f"Not using OpenBLAS for PyPy in Azure CI, so skip this")
338 return
339 raise ValueError(f"expected single threadpool_info result, got {data}")
340 if not expected_version:
341 expected_version = OPENBLAS_V
342 if data[0]['version'] != expected_version:
343 raise ValueError(
344 f"expected OpenBLAS version {expected_version}, got {data}"
345 )
346 print("OK")
347
348if __name__ == '__main__':
349 import argparse

Callers 1

Calls 1

printFunction · 0.85

Tested by

no test coverage detected