(self)
| 4812 | assert_(res is nomask, msgformat % (cpy, shr, dt)) |
| 4813 | |
| 4814 | def test_mask_or(self): |
| 4815 | # Initialize |
| 4816 | mtype = [('a', bool), ('b', bool)] |
| 4817 | mask = np.array([(0, 0), (0, 1), (1, 0), (0, 0)], dtype=mtype) |
| 4818 | # Test using nomask as input |
| 4819 | test = mask_or(mask, nomask) |
| 4820 | assert_equal(test, mask) |
| 4821 | test = mask_or(nomask, mask) |
| 4822 | assert_equal(test, mask) |
| 4823 | # Using False as input |
| 4824 | test = mask_or(mask, False) |
| 4825 | assert_equal(test, mask) |
| 4826 | # Using another array w / the same dtype |
| 4827 | other = np.array([(0, 1), (0, 1), (0, 1), (0, 1)], dtype=mtype) |
| 4828 | test = mask_or(mask, other) |
| 4829 | control = np.array([(0, 1), (0, 1), (1, 1), (0, 1)], dtype=mtype) |
| 4830 | assert_equal(test, control) |
| 4831 | # Using another array w / a different dtype |
| 4832 | othertype = [('A', bool), ('B', bool)] |
| 4833 | other = np.array([(0, 1), (0, 1), (0, 1), (0, 1)], dtype=othertype) |
| 4834 | try: |
| 4835 | test = mask_or(mask, other) |
| 4836 | except ValueError: |
| 4837 | pass |
| 4838 | # Using nested arrays |
| 4839 | dtype = [('a', bool), ('b', [('ba', bool), ('bb', bool)])] |
| 4840 | amask = np.array([(0, (1, 0)), (0, (1, 0))], dtype=dtype) |
| 4841 | bmask = np.array([(1, (0, 1)), (0, (0, 0))], dtype=dtype) |
| 4842 | cntrl = np.array([(1, (1, 1)), (0, (1, 0))], dtype=dtype) |
| 4843 | assert_equal(mask_or(amask, bmask), cntrl) |
| 4844 | |
| 4845 | def test_flatten_mask(self): |
| 4846 | # Tests flatten mask |
nothing calls this directly
no test coverage detected