![](https://secure.gravatar.com/avatar/788e9f211717fff4949bef64aa7d3318.jpg?s=120&d=mm&r=g)
In "numerictypes.py' it says "This module is designed so 'from numerictypes import *' is safe." When I "import numerictypes", and run dir(), I get: ['Any', 'AnyType', 'Bool', 'BooleanType', 'Byte', 'Complex', 'Complex32', 'Complex64', 'ComplexType', 'Double', 'Float', 'Float32', 'Float64', 'FloatingType', 'Int', 'Int16', 'Int32', 'Int64', 'Int8', 'IntegralType', 'Long', 'MAX_ALIGN', 'NumericType', 'Short', 'SignedIntegralType', 'SignedType', 'UInt16', 'UInt32', 'UInt64', 'UInt8', 'UnsignedIntegralType', 'UnsignedType', '__builtins__', '__doc__', '__name__', 'genericCoercions', 'genericPromotionExclusions', 'genericTypeRank', 'inttype1', 'inttype2', 'kind', 'mapto', 'maptype1', 'maptype2', 'nt1', 'nt2', 'ntypesize1', 'ntypesize2', 'numinclude', 'outtype', 'pythonTypeMap', 'pythonTypeRank', 'rank1', 'rank2', 'scalarTypeMap', 'signedtype1', 'signedtype2', 'typeDict', 'typecode', 'typecodes'] A bunch of leading "_" are needed. ---------------- My code is: #! /usr/bin/env python from numerictypes import UInt8 print UInt8 == "ABC" The message is: Traceback (most recent call last): File "./silly02.py", line 5, in ? print UInt8 == "ABC" File "/usr/lib/python2.2/site-packages/numarray/numerictypes.py", line 101, in __cmp__ other = typeDict[other] KeyError: ABC I would expect that the only object == to UInt8 be itself. Maybe add a function comparetypecodes(x, y) which returns True iff x and y are either NumericType's or strings which represent the same type.
![](https://secure.gravatar.com/avatar/6194b135cba546afa82516de1537de49.jpg?s=120&d=mm&r=g)
Hi! Somehow I have a problem with numarray. Please take a look at this:
The same workes fine with Numeric. But I would prefer numarray because I'm writing C++-extensions and I need "unsigned shorts". What is this error about? Thanks, Sebastian
![](https://secure.gravatar.com/avatar/faf9400121dca9940496a7473b1d8179.jpg?s=120&d=mm&r=g)
Sebastian Haase wrote:
Hi! Somehow I have a problem with numarray. Please take a look at this:
Hi Sebastian, I've don't recall seeing anything like this, nor can I reproduce it now. If you've been following numarray for a while now, I can say that it is important to remove the old version of numarray before installing the new version. I recommend deleting your current installation and reinstalling numarray. compress() is a ufunc, much like add() or put(). It is defined in ndarray.py, right after the import of the modules ufunc and _ufunc. _ufunc in particular is a problematic module, because it has followed the atypical development path of moving from C-code to Python code. Because of this, and the fact that a .so or .dll overrides a .py, older installations interfere with newer ones. The atypical path was required because the original _ufuncmodule.c was so large that it could not be compiled on some systems; as a result, I split _ufuncmodule.c into pieces by data type and now use _ufunc.py to glue the pieces together. Good luck! Please let me know if reinstalling doesn't clear up the problem. Todd
![](https://secure.gravatar.com/avatar/6194b135cba546afa82516de1537de49.jpg?s=120&d=mm&r=g)
Hi, I can print numarray of any int time just fine, but I still get the compress error message with Float (or complex) data:
I get this on Windows (2000) and on Linux. Both numarray 0.4 Thanks, Sebastian ----- Original Message ----- From: "Todd Miller" <jmiller@stsci.edu> To: "Sebastian Haase" <haase@msg.ucsf.edu> Cc: <Numpy-discussion@lists.sourceforge.net> Sent: Thursday, December 19, 2002 5:58 AM Subject: Re: [Numpy-discussion] Have a problem: what is attribute 'compress'
![](https://secure.gravatar.com/avatar/faf9400121dca9940496a7473b1d8179.jpg?s=120&d=mm&r=g)
Sebastian Haase wrote:
Hi, I can print numarray of any int time just fine, but
OK. I am assuming you deleted all of your old numarray installations as I recommended and reinstalled numarray-0.4. What is your PYTHONPATH?
I'm not sure what's going on here, but I develop on both platforms, and Linux constantly. The self tests definitely pass in Linux. It must be some kind of environment issue or runtime issue. What happens when you type:
![](https://secure.gravatar.com/avatar/6194b135cba546afa82516de1537de49.jpg?s=120&d=mm&r=g)
Hi! Somehow I have a problem with numarray. Please take a look at this:
The same workes fine with Numeric. But I would prefer numarray because I'm writing C++-extensions and I need "unsigned shorts". What is this error about? Thanks, Sebastian
![](https://secure.gravatar.com/avatar/faf9400121dca9940496a7473b1d8179.jpg?s=120&d=mm&r=g)
Sebastian Haase wrote:
Hi! Somehow I have a problem with numarray. Please take a look at this:
Hi Sebastian, I've don't recall seeing anything like this, nor can I reproduce it now. If you've been following numarray for a while now, I can say that it is important to remove the old version of numarray before installing the new version. I recommend deleting your current installation and reinstalling numarray. compress() is a ufunc, much like add() or put(). It is defined in ndarray.py, right after the import of the modules ufunc and _ufunc. _ufunc in particular is a problematic module, because it has followed the atypical development path of moving from C-code to Python code. Because of this, and the fact that a .so or .dll overrides a .py, older installations interfere with newer ones. The atypical path was required because the original _ufuncmodule.c was so large that it could not be compiled on some systems; as a result, I split _ufuncmodule.c into pieces by data type and now use _ufunc.py to glue the pieces together. Good luck! Please let me know if reinstalling doesn't clear up the problem. Todd
![](https://secure.gravatar.com/avatar/6194b135cba546afa82516de1537de49.jpg?s=120&d=mm&r=g)
Hi, I can print numarray of any int time just fine, but I still get the compress error message with Float (or complex) data:
I get this on Windows (2000) and on Linux. Both numarray 0.4 Thanks, Sebastian ----- Original Message ----- From: "Todd Miller" <jmiller@stsci.edu> To: "Sebastian Haase" <haase@msg.ucsf.edu> Cc: <Numpy-discussion@lists.sourceforge.net> Sent: Thursday, December 19, 2002 5:58 AM Subject: Re: [Numpy-discussion] Have a problem: what is attribute 'compress'
![](https://secure.gravatar.com/avatar/faf9400121dca9940496a7473b1d8179.jpg?s=120&d=mm&r=g)
Sebastian Haase wrote:
Hi, I can print numarray of any int time just fine, but
OK. I am assuming you deleted all of your old numarray installations as I recommended and reinstalled numarray-0.4. What is your PYTHONPATH?
I'm not sure what's going on here, but I develop on both platforms, and Linux constantly. The self tests definitely pass in Linux. It must be some kind of environment issue or runtime issue. What happens when you type:
participants (3)
-
Edward C. Jones
-
Sebastian Haase
-
Todd Miller