8000 Preserve mask through math operations by DPeterK · Pull Request #167 · SciTools/biggus · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Feb 17, 2023. It is now read-only.

Preserve mask through math operations #167

Merged
merged 2 commits into from
Nov 20, 2015
Merged

Conversation

DPeterK
Copy link
Member
@DPeterK DPeterK commented Nov 20, 2015

Ensure masked arrays are handled correctly (i.e. the mask is preserved) when performing mathematical operations using biggus operation functions such as biggus.log10 or biggus.power.

Fixes #166.


def test_single_argument_operation(self):
actual = Elementwise(self.masked_array, None, np.abs, ma.abs)
assert_array_equal(actual.masked_array().mask, self.mask)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to test the data here too.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Evidently I'm now used to never testing actual numbers 😉

@pelson
Copy link
Member
pelson commented Nov 20, 2015

Great fix! Thanks @dkillick. The only change is to the tests (to ensure the numbers are correct).

👍

@DPeterK
Copy link
Member Author
DPeterK commented Nov 20, 2015

Now with numbers tests too.

pelson added a commit that referenced this pull request Nov 20, 2015
Preserve mask through math operations
@pelson pelson merged commit 6e3269e into SciTools:master Nov 20, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0