From: Jan-Matthias B. <jan...@gm...> - 2006-07-04 10:10:20
|
Hi all, I'm testing some computations with float96 at the moment and right now I ha= ve=20 problems with polyfit raising a KeyError for the keycode 'g', which is=20 floatxx with xx>64.=20 I am getting a KeyError using polyfit on some float96 values. The used=20 Routines seem to know nothing about this type. My main question is: have I missed something? Shouldn't this type be used? Below is a more detailed descripton. Thanks in advance, Jan =2D------------------------------------------------------------------------= =2D-- In file numpy/linalg/linalg.py, the following definitions at lines 26ff see= m=20 to be the offending ones: # Helper routines _array_kind =3D {'i':0, 'l': 0, 'q': 0, 'f': 0, 'd': 0, 'F': 1, 'D': 1} _array_precision =3D {'i': 1, 'l': 1, 'q': 1, 'f': 0, 'd': 1, 'F': 0, 'D':= 1} _array_type =3D [['f', 'd'], ['F', 'D']] Here the new typecodes are missing. I tried=20 # Helper routines _array_kind =3D {'i':0, 'l': 0, 'q': 0, 'f': 0, 'd': 0, 'g': '0', 'F': 1,= =20 'D':1, 'G':1} _array_precision =3D {'i': 1, 'l': 1, 'q': 1, 'f': 0, 'd': 1, 'g': 1,=20 'F': 0, 'D': 1, 'G': 1} _array_type =3D [['f', 'd', 'g'], ['F', 'D', 'G']] which gets me a step further to a TypeError: File "lib/python2.3/site-packages/numpy/linalg/linalg.py", line 454, in=20 lstsq bstar[:b.shape[0],:n_rhs] =3D b.copy() TypeError: array cannot be safely cast to required type (Question: Why only one typecode for a type which varies in bitlength on=20 different platforms? On Opteron CPU's I've seen float128 with 'g'?) |