I have applied the patch with minor modifications. See <http://projects.scipy.org/scipy/numpy/changeset/2331>.
Here are a few suggestions for posting patches.
1. If you are using svn, please post output of "svn diff" in the project root directory (the directory that *contains* "numpy", not the "numpy" directory.
2. If appropriate, add unit tests to an existing file instead of creating a new one. (In case of ma, the correct file is test_ma.py).
3. If you follow recommendation #1, this will happen automatically, if you cannot use svn for some reason, concatenate the output of diff for code and test in the same patch file.
Here are some topics for discussion.
1. I've initially implemented some ma array methods by wrapping existing module level functions. I am not sure this is the best approach to implement new methods. It is probably cleaner to implement them as methods and provide wrappers at the module level similar to oldnumeric.
2. I am not sure cumprod and cumsum should fill masked elements with 1 and 0. I would think the result should be masked if any prior element along the axis being accumulated is masked. To ignore masked elements, filled can be called explicitly before cum[prod|sum]. One of the problems with filling by default is that 1 or 0 are not appropriate values for object arrays (for example, "" is an appropriate fill value for cumsum of an array of strings).
You can find a new patch for MA on the wiki
along with a test suite.
The 'clip' method should now work with array arguments. Were also added
cumsum, cumprod, std, var and squeeze.
I'll deal with flags, setflags, setfield, dump and others when I'll have a
better idea of how it works -- which probably won't happen anytime soon, as I
don't really have time to dig in the code for these functions. AAMOF, I'm
more interested in checking/patching some other aspects of numpy for MA (eg,
Once again, please send me your comments and suggestions.
Thx for everything
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
Numpy-discussion mailing list