Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix handling of numexpr.cpu in print_versions() #495

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions numexpr/tests/test_numexpr.py
Original file line number Diff line number Diff line change
Expand Up @@ -1334,15 +1334,13 @@ def print_versions():
print('Python version: %s' % sys.version)
(sysname, nodename, release, os_version, machine, processor) = platform.uname()
print('Platform: %s-%s-%s' % (sys.platform, machine, os_version))
try:
# cpuinfo doesn't work on OSX well it seems, so protect these outputs
# with a try block
cpu_info = cpu.info[0]
if type(cpu).__name__ != 'CPUInfoBase':
cpu_info = cpu.info
if isinstance(cpu_info, list):
cpu_info = cpu_info[0]
print('CPU vendor: %s' % cpu_info.get('VendorIdentifier', ''))
print('CPU model: %s' % cpu_info.get('ProcessorNameString', ''))
print('CPU clock speed: %s MHz' % cpu_info.get('~MHz',''))
except KeyError:
pass
print('VML available? %s' % use_vml)
if use_vml:
print('VML/MKL version: %s' % numexpr.get_vml_version())
Expand Down
Loading