On Saturday 24 June 2006 13:12, Pierre GM wrote:
> I haven't really time to double-check/create a patch, tough. Meanwhile,
> Michael, you could just modify your numpy/core/ma.py accordingly.
Hi Pierre,
Thank you for the fix. I checked it out and and numpy now behaves correctly
for 0**1. in masked arrays. Attached are the diffs for numpy (scipy.org SVN)
and numarray (sf.net CVS).
Mike
Index: Packages/MA/Lib/MA.py
===================================================================
RCS file: /cvsroot/numpy/numarray/Packages/MA/Lib/MA.py,v
retrieving revision 1.15
diff -u -F^f -r1.15 MA.py
--- Packages/MA/Lib/MA.py 13 Oct 2005 18:37:17 -0000 1.15
+++ Packages/MA/Lib/MA.py 26 Jun 2006 01:02:07 -0000
@@ -1618,7 +1618,7 @@ fmod = domained_binary_operation(Numeric
fb = filled(b, 1)
if fb.typecode() in typecodes["Integer"]:
return masked_array(Numeric.power(fa, fb), m)
- md = make_mask(Numeric.less_equal (fa, 0), flag=1)
+ md = make_mask(Numeric.less(fa, 0), flag=1)
m = mask_or(m, md)
if m is None:
return masked_array(Numeric.power(fa, fb))
Index: numpy/core/ma.py
===================================================================
--- numpy/core/ma.py (revision 2677)
+++ numpy/core/ma.py (working copy)
@@ -1574,7 +1574,7 @@
fb = filled(b, 1)
if fb.dtype.char in typecodes["Integer"]:
return masked_array(umath.power(fa, fb), m)
- md = make_mask(umath.less_equal (fa, 0), flag=1)
+ md = make_mask(umath.less(fa, 0), flag=1)
m = mask_or(m, md)
if m is nomask:
return masked_array(umath.power(fa, fb))
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion