String representation of software versions that NumExpr imports and CPU information.
()
| 86 | # There's no setter for ncores |
| 87 | |
| 88 | def str_info() -> str: |
| 89 | """String representation of software versions that NumExpr imports and CPU information.""" |
| 90 | global _nthreads, _ncores |
| 91 | |
| 92 | repr = [] |
| 93 | repr.append('-=' * 38) |
| 94 | repr.append("Numexpr version: %s" % numexpr3.__version__) |
| 95 | repr.append("NumPy version: %s" % np.__version__) |
| 96 | repr.append('Python version: %s' % sys.version) |
| 97 | try: |
| 98 | (sysname, nodename, release, version, machine) = os.uname() |
| 99 | repr.append('Platform: %s-%s' % (sys.platform, machine)) |
| 100 | except AttributeError: |
| 101 | repr.append('Platform: %s-%s' % (sys.platform, os.name)) |
| 102 | # repr.append("VML available? %s" % use_vml) |
| 103 | # try: repr.append("VML/MKL version: %s" % numexpr3.get_vml_version()) |
| 104 | # except NameError: pass |
| 105 | repr.append("Number of threads used by default: %d " |
| 106 | "(out of %d detected cores)" % (_nthreads, _ncores)) |
| 107 | |
| 108 | ## Unfortuantely cpuinfo is too slow, this doubles the test time (!!!) on Windows. |
| 109 | # repr.append( "CPU information: " ) |
| 110 | # repr.append( "_"*78 ) |
| 111 | # _cpu_info = _cpu_info |
| 112 | # if _cpu_info: |
| 113 | # repr.append('Vendor ID: {0}'.format(_cpu_info.get('vendor_id', ''))) |
| 114 | # repr.append('Brand: {0}'.format(_cpu_info.get('brand', ''))) |
| 115 | # repr.append('Hz Actual: {0}'.format(_cpu_info.get('hz_actual', ''))) |
| 116 | # repr.append('Arch: {0}'.format(_cpu_info.get('arch', ''))) |
| 117 | # repr.append('Bits: {0}'.format(_cpu_info.get('bits', ''))) |
| 118 | # repr.append('Core Count: {0}'.format(_cpu_info.get('count', ''))) |
| 119 | # repr.append('L2 Cache Size: {0}'.format(_cpu_info.get('l2_cache_size', ''))) |
| 120 | # repr.append('L2 Cache Line Size: {0}'.format(_cpu_info.get('l2_cache_line_size', ''))) |
| 121 | # repr.append('L2 Cache Associativity: {0}'.format(_cpu_info.get('l2_cache_associativity', ''))) |
| 122 | # repr.append('Stepping: {0}'.format(_cpu_info.get('stepping', ''))) |
| 123 | # repr.append('Model: {0}'.format(_cpu_info.get('model', ''))) |
| 124 | # repr.append('Family: {0}'.format(_cpu_info.get('family', ''))) |
| 125 | # repr.append('Processor Type: {0}'.format(_cpu_info.get('processor_type', ''))) |
| 126 | # repr.append('Extended Model: {0}'.format(_cpu_info.get('extended_model', ''))) |
| 127 | # repr.append('Extended Family: {0}'.format(_cpu_info.get('extended_family', ''))) |
| 128 | # repr.append('Flags: {0}'.format(', '.join(_cpu_info.get('flags', '')))) |
| 129 | repr.append('-=' * 38) |
| 130 | return ''.join(repr) |
| 131 | |
| 132 | def print_info() -> None: |
| 133 | """Print software versions that NumExpr imports and CPU information.""" |
no outgoing calls
no test coverage detected
searching dependent graphs…