/usr/lib/python2.7/dist-packages/dispcalGUI/oldnumeric.py is in dispcalgui 1.7.1.6-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | # -*- coding: utf-8 -*-
"""
Compatibility module for wxenhancedplot
This is NOT a complete replacement for oldnumeric
The oldnumeric module will be dropped in Numpy 1.9
"""
from numpy import (add, arange, argmin, array, ceil, compress, concatenate, cos,
fabs, floor, log10, maximum, minimum, pi, power, repeat, sin,
sometrue, sqrt, transpose, zeros)
typecodes = {'Integer':'bhil', 'Float':'fd'}
def _get_precisions(typecodes):
lst = []
for t in typecodes:
lst.append( (zeros( (1,), t ).itemsize*8, t) )
return lst
def _fill_table(typecodes, table={}):
for key, value in typecodes.items():
table[key] = _get_precisions(value)
return table
_code_table = _fill_table(typecodes)
class PrecisionError(Exception):
pass
def _lookup(table, key, required_bits):
lst = table[key]
for bits, typecode in lst:
if bits >= required_bits:
return typecode
raise PrecisionError, key+" of "+str(required_bits)+" bits not available on this system"
try:
Int32 = _lookup(_code_table, 'Integer', 32)
except(PrecisionError):
pass
try:
Float64 = _lookup(_code_table, 'Float', 64)
except(PrecisionError):
pass
Float = 'd'
|