Skip to content
This repository has been archived by the owner on Feb 17, 2023. It is now read-only.

Commit

Permalink
BUG: Failing type return on masked array on LHS
Browse files Browse the repository at this point in the history
  • Loading branch information
Carwyn Pelley committed Oct 20, 2016
1 parent 6d2ca60 commit 7da22e6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions biggus/tests/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,16 @@ def test_mean_of_mean(self):
result = mean2.ndarray()
np.testing.assert_array_equal(result, expected)

def test_masked_array_numpy_first_biggus_second(self):
# Ensure that an operation where the biggus array is second (i.e.
# calling the special method of the numpy array not the biggus array,
# returns the expected type).
arr = np.ma.array([1, 2, 3], mask=[False, True, False])
barr = biggus.NumpyArrayAdapter(arr)
target_type = type(np.array([[ 1.]]) * arr)
resulting_type = type(np.array([[ 1.]]) * barr)
self.assertIs(resulting_type, target_type)


if __name__ == '__main__':
unittest.main()

0 comments on commit 7da22e6

Please sign in to comment.