[NumPy-Tickets] [NumPy] #1666: Reducing the memory usage of MaskedArrays after DomainedBinaryOperation
NumPy Trac
numpy-tickets@scipy....
Mon Nov 8 14:03:07 CST 2010
#1666: Reducing the memory usage of MaskedArrays after DomainedBinaryOperation
-------------------------------+--------------------------------------------
Reporter: lee | Owner: pierregm
Type: enhancement | Status: new
Priority: normal | Milestone: Unscheduled
Component: numpy.ma | Version: 1.5.0
Keywords: mask memory usage |
-------------------------------+--------------------------------------------
I noticed that when I create a new masked array with no mask (yet) I am
given a mask=False. After dividing this mask by a nonzero number, the mask
becomes the same shape as the array, populated entirely with 'False'. I
would like to not increase my memory usage unnecessarily after safe
operations.
I attempted to patch the ma/core.py file to check the mask: If all entries
are False, the mask is not applied to the result. The patch works for
divide, but not for mod (%). It doesn't seem like mod passes through
_DomainedBinaryOperation.__call__ even though it is decorated as such in
ma/core.py .
Is there another location that overrides this mod operation that I
can/should patch? Is this patch even useful or a good idea?
- Chris
--
Ticket URL: <http://projects.scipy.org/numpy/ticket/1666>
NumPy <http://projects.scipy.org/numpy>
My example project
More information about the NumPy-Tickets
mailing list