pydata / numexpr

Fast numerical array expression evaluator for Python, NumPy, Pandas, PyTables and more
https://numexpr.readthedocs.io/en/latest/user_guide.html
MIT License
2.21k stars 207 forks source link

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

Open pinotree opened 3 weeks ago

pinotree commented 3 weeks ago

There are a couple of issues in the way numexpr.cpu.info is used in print_versions():

1) all the subclasses of CPUInfoBase have a class attribute info, whereas CPUInfoBase does not; this means that, in case there is no CPU implementation for an OS, self.info returns a function (because of CPUInfoBase.__getattr__()) which is not subscriptable 2) only few subclasses of CPUInfoBase (e.g. LinuxCPUInfo, Win32CPUInfo) implement info as list of dicts for each CPU, whereas the rest of the implementations use a dict with attributes

Since info seems to be mostly an internal detail, then adapt print_versions() to be a little more flexible:

pinotree commented 15 hours ago

@FrancescAlted would you please take a look at this? thanks in advance!

FrancescAlted commented 12 hours ago

Can you tell us what advantages that brings for users?