-
Notifications
You must be signed in to change notification settings - Fork 300
Remove usages of replace() method #2708
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
Conversation
lib/iris/tests/test_basic_maths.py
Outdated
| self.cube = iris.tests.stock.global_pp() | ||
| self.cube.replace(self.cube.data - 260, | ||
| fill_value=self.cube.fill_value) | ||
| self.cube.data = self.cube.data - 260) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll remove this bracket!
93aacc9 to
05865dc
Compare
| src = self.src | ||
| src.coord('longitude').circular = True | ||
| src.replace(ma.MaskedArray(src.data), fill_value=src.fill_value) | ||
| src.data = ma.MaskedArray(src.data, fill_value=src.fill_value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lbdreyer Are there two spaces in src.data^^= ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, now fixed.
05865dc to
6476dd0
Compare
Which tests are you referring to? |
|
|
The |
|
One thing we did do was increase test coverage thru replacing biggus with dask. For me |
|
@bjlittle |
| src = self.src | ||
| src.coord('longitude').circular = True | ||
| src.replace(ma.MaskedArray(src.data), fill_value=src.fill_value) | ||
| src.data = ma.MaskedArray(src.data, fill_value=src.fill_value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lbdreyer But there is no src.fill_value ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In this test src was loaded in from a pp file, so the src.fill_value would presumably have been the bmdi value.
However, this test doesn't really care about the fill value so I have just let it use the numpy default fill_value
|
@lbdreyer Thanks, this looks good to me 👍 |
Fixes #2705