diff options
author | mattip <matti.picus@gmail.com> | 2022-12-21 11:55:34 +0200 |
---|---|---|
committer | mattip <matti.picus@gmail.com> | 2022-12-21 12:07:36 +0200 |
commit | 67b20a5065d634d6f7301fbc2fc5e5e263400ac9 (patch) | |
tree | 54653cacf1629576983ed6983e19b653a1ff05f3 | |
parent | 0d1bb8e42228776dc8d35bdcfacf2ff3af366ade (diff) | |
download | numpy-67b20a5065d634d6f7301fbc2fc5e5e263400ac9.tar.gz |
MAINT: expand show_rutime, add it to issue template [skip ci]
-rw-r--r-- | .github/ISSUE_TEMPLATE/bug-report.yml | 8 | ||||
-rw-r--r-- | numpy/lib/utils.py | 40 |
2 files changed, 14 insertions, 34 deletions
diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index cfb07f450..9985cb79f 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -45,8 +45,10 @@ body: - type: textarea attributes: - label: "NumPy/Python version information:" - description: Output from `import sys, numpy; print(numpy.__version__, sys.version)`. + label: "Runtime information:" + description: > + Output from `import sys, numpy; print(numpy.__version__) print(sys.version))` + If you are running NumPy 1.24+, also show `print(numpy.show_runtime())` validations: required: true @@ -58,4 +60,4 @@ body: placeholder: | << your explanation here >> validations: - required: false
\ No newline at end of file + required: false diff --git a/numpy/lib/utils.py b/numpy/lib/utils.py index 2a9d30b16..8d2d2fe33 100644 --- a/numpy/lib/utils.py +++ b/numpy/lib/utils.py @@ -5,6 +5,7 @@ import types import re import warnings import functools +import platform from .._utils import set_module from numpy.core.numerictypes import issubclass_, issubsctype, issubdtype @@ -24,6 +25,8 @@ def show_runtime(): including available intrinsic support and BLAS/LAPACK library in use + .. versionadded:: 1.24.0 + See Also -------- show_config : Show libraries in the system on which NumPy was built. @@ -31,45 +34,20 @@ def show_runtime(): Notes ----- 1. Information is derived with the help of `threadpoolctl <https://pypi.org/project/threadpoolctl/>`_ - library. + library if available. 2. SIMD related information is derived from ``__cpu_features__``, ``__cpu_baseline__`` and ``__cpu_dispatch__`` - Examples - -------- - >>> import numpy as np - >>> np.show_runtime() - [{'simd_extensions': {'baseline': ['SSE', 'SSE2', 'SSE3'], - 'found': ['SSSE3', - 'SSE41', - 'POPCNT', - 'SSE42', - 'AVX', - 'F16C', - 'FMA3', - 'AVX2'], - 'not_found': ['AVX512F', - 'AVX512CD', - 'AVX512_KNL', - 'AVX512_KNM', - 'AVX512_SKX', - 'AVX512_CLX', - 'AVX512_CNL', - 'AVX512_ICL']}}, - {'architecture': 'Zen', - 'filepath': '/usr/lib/x86_64-linux-gnu/openblas-pthread/libopenblasp-r0.3.20.so', - 'internal_api': 'openblas', - 'num_threads': 12, - 'prefix': 'libopenblas', - 'threading_layer': 'pthreads', - 'user_api': 'blas', - 'version': '0.3.20'}] """ from numpy.core._multiarray_umath import ( __cpu_features__, __cpu_baseline__, __cpu_dispatch__ ) from pprint import pprint - config_found = [] + config_found = [{ + "numpy_version": np.__version__, + "python": sys.version, + "uname": platform.uname(), + }] features_found, features_not_found = [], [] for feature in __cpu_dispatch__: if __cpu_features__[feature]: |