Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mean broken on MV array #2088

Closed
doutriaux1 opened this issue Aug 15, 2016 · 4 comments
Closed

mean broken on MV array #2088

doutriaux1 opened this issue Aug 15, 2016 · 4 comments
Assignees
Milestone

Comments

@doutriaux1
Copy link
Contributor

In [1]: import MV2

In [2]: a=MV2.ones((13,14))

In [3]: a.mean()
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-4-dc887f7a7bfb> in <module>()
----> 1 a.mean()

/export/doutriaux1/anaconda2/envs/blah/lib/python2.7/site-packages/numpy/ma/core.pyc in mean(self, axis, dtype, out)
   4779         """
   4780         if self._mask is nomask:
-> 4781             result = super(MaskedArray, self).mean(axis=axis, dtype=dtype)
   4782         else:
   4783             dsum = self.sum(axis=axis, dtype=dtype)

/export/doutriaux1/anaconda2/envs/blah/lib/python2.7/site-packages/numpy/core/_methods.pyc in _mean(a, axis, dtype, out, keepdims)
     67     if isinstance(ret, mu.ndarray):
     68         ret = um.true_divide(
---> 69                 ret, rcount, out=ret, casting='unsafe', subok=False)
     70     elif hasattr(ret, 'dtype'):
     71         ret = ret.dtype.type(ret / rcount)

/export/doutriaux1/anaconda2/envs/blah/lib/python2.7/site-packages/numpy/ma/core.pyc in __array_wrap__(self, obj, context)
   2897                 return masked
   2898             else:
-> 2899                 result._mask = m
   2900                 result._sharedmask = False
   2901         #....

AttributeError: 'numpy.ndarray' object has no attribute '_mask'
@dnadeau4
Copy link
Contributor

@doutriaux1 What is your cdms2.MV2.numpy.version.version. I have 1.11.1 and this test works fine.

@doutriaux1
Copy link
Contributor Author

@dnadeau4 that was my suspicion, I'm using 1.9.2, let's try to merge numpy 1.11 in as fast as possible.

@doutriaux1
Copy link
Contributor Author

oh and let's add a test for this as well.

@dnadeau4
Copy link
Contributor

This issue was moved to CDAT/cdms#4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants