Skip to content

Public contiguity checking#3144

Merged
pp-mo merged 21 commits into
SciTools:masterfrom
corinnebosley:public_contiguity_checking
Oct 11, 2018
Merged

Public contiguity checking#3144
pp-mo merged 21 commits into
SciTools:masterfrom
corinnebosley:public_contiguity_checking

Conversation

@corinnebosley

Copy link
Copy Markdown
Member

This PR contains:

plot.py:

  • minor changes to function names, just for clarity
  • if a user tries to plot an unmasked discontiguous array, they now get a warning with advice on how to fix this rather than an error

test_2d_coords.py:

  • changed a class name to something more appropriate
  • moved some tests from Test_2d_coords_bound_mode to new class TestContiguityChecking
  • Added minimal set of tests to TestContiguityChecking

util.py:

  • new function find_discontiguity()
  • new_function mask_discontiguity()

Enjoy!

Comment thread lib/iris/plot.py Outdated
'where the discontiguity occurs. The ' \
'mesh created for this plot may cause a ' \
'misrepresentation of the input data. ' \
'Please use iris.contiguity_check(coord) ' \

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

E501 line too long (80 > 79 characters)

Comment thread lib/iris/plot.py Outdated
anchor.patch.set_boxstyle('round, pad=0, rounding_size=0.2')
axes = axes if axes else figure.gca()
axes.add_artist(anchor)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

W391 blank line at end of file

returned = find_discontiguities(coord)
self.assertEqual(expected, returned)

# TODO Make sure everything works when there are multiple discontiguities

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

E501 line too long (81 > 79 characters)

@corinnebosley

Copy link
Copy Markdown
Member Author

I can already see that I could do with making these changes:

  • change test_2d_coords.py class name 'Test_2d_coords_bound_mode' to camel case
  • add test for multiple discontiguities (as stated in TODO which is left in there)

Comment thread lib/iris/plot.py Outdated


def _check_contiguity_and_bounds(coord, data, abs_tol=1e-4, transpose=False):
def _check_contiguity_and_mask(coord, data, abs_tol=1e-4, transpose=False):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I agree with the inclusion of mask but by not mentioning bounds it isn't clear that that's what it is referring to.
How about _check_bounds_contiguity_and_mask?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah that'll do. It's a bit of a mouthful but it's private anyway so it shouldn't matter.

Comment thread lib/iris/plot.py Outdated
' Matplotlib'.format(coord.name()))
discontiguity_warning = 'The bounds of the {} coordinate are ' \
'not contiguous and data is not masked ' \
'where the discontiguity occurs. The ' \

@lbdreyer lbdreyer Aug 16, 2018

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Not a change you've made but now rereading through this intial sentence I see it doesn't make sense. We say discontiguous twice: "The bounds of the {} coordinate are not contiguous ... where the discontiguity occurs.".

@lbdreyer lbdreyer Aug 16, 2018

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Oh I see, this says "there is a discontiguity and the data is not masked where that discontiguity is (or are)"

@corinnebosley

Copy link
Copy Markdown
Member Author

@lbdreyer The changes I made for the last commit prompted numpy to give me this warning:
"FutureWarning: Using a non-tuple sequence for multidimensional indexing is deprecated; use arr[tuple(seq)] instead of arr[seq]. In the future this will be interpreted as an array index, arr[np.array(seq)], which will result either in an error or a different result."

I'm not exactly sure what it's referring to, I have a horrible feeling it's something to do with the zip output, and that's been a really horrible nightmare to put into a user-friendly return format.

We will obviously have to address this at some point, but I could do with your help with it I think.

Comment thread lib/iris/util.py
"""

from __future__ import (absolute_import, division, print_function)
from six.moves import (filter, input, map, range, zip) # noqa

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We are using these two lines as boilerplate for all our modules to help with Python 3 compatibility. (you'll find them at the top of all files.)
I think it would be best to keep all of them (even if they aren't being used) as otherwise we may forget to include them.
In fact that is what the #noqa tag is there for - to stop flake8 complaining about unused imports

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I didn't even realise it wasn't there. I'll pop it in.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

No idea how I removed that...

Comment thread lib/iris/util.py Outdated

(b) the :attr:`standard_name`, :attr:`long_name`, or
:attr:`var_name` of an instance of an instance of
:class:`iris.coords.Coord`.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If you are going to allow for a user to do this, you need to also add a line at the start that gets the coordinate.
This function starts by doing

_, diffs_x, diffs_y = iris.coords._discontiguity_in_2d_bounds(coord.bounds,
                                                                  abs_tol)

so if that needs to be a coord instance by then

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Thing is, if we do allow that user to use a name instead of a coord object, then we have to pass the cube in as well so that we can get the coord. This seems a bit unnecessary, so it might make sense to only allow a coord object.

Comment thread lib/iris/plot.py Outdated
try:
_check_contiguity_and_bounds(coord, data=cube.data,
abs_tol=twodim_contig_atol)
_check_contiguity_and_mask(coord, data=cube.data,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

F821 undefined name '_check_contiguity_and_mask'

Comment thread lib/iris/plot.py Outdated
if _check_contiguity_and_bounds(coord, data=cube.data,
abs_tol=twodim_contig_atol,
transpose=True) is True:
if _check_contiguity_and_mask(coord, data=cube.data,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

F821 undefined name '_check_contiguity_and_mask'

Comment thread lib/iris/plot.py Outdated
_check_contiguity_and_bounds(coord, data=cube.data,
abs_tol=twodim_contig_atol)
_check_bounds_contiguity_and_mask(coord, data=cube.data,
abs_tol=twodim_contig_atol)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

E128 continuation line under-indented for visual indent

Comment thread lib/iris/plot.py Outdated
abs_tol=twodim_contig_atol,
transpose=True) is True:
if _check_bounds_contiguity_and_mask(coord, data=cube.data,
abs_tol=twodim_contig_atol,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

E128 continuation line under-indented for visual indent

Comment thread lib/iris/plot.py Outdated
transpose=True) is True:
if _check_bounds_contiguity_and_mask(coord, data=cube.data,
abs_tol=twodim_contig_atol,
transpose=True) is True:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

E128 continuation line under-indented for visual indent

Comment thread lib/iris/util.py Outdated
absolute tolerance in degrees

Returns:
Dictionary of values representing data array indices where

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm a bit 👎 on this.
Would it not be much simpler to return an boolean array of ok/bad-point values ?
Likewise in the code, avoid use of np.where + just use boolean arrays
bad = (diffs_x > abs_tol) | (diffs_y > abs_tol)

@corinnebosley corinnebosley Aug 17, 2018

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Not really. Not simpler. You still have to move everything along by one point to the right for x-values and down for y-values because the bad point is after the discontiguity in the array. That's really where the complication arises.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Also I don't see how that's any more use to the user. If they have a particularly large dataset then they will have to search through it for places where it's True anyway, so what's the point?

And also, would we return the boolean array for the data or for the coord points? What are you expecting the user to do with a boolean array?

Comment thread lib/iris/util.py Outdated
return None


def mask_discontiguities(coord, data, abs_tol=1e-4):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I thought if we did have a simple boolean array from the previous, this routine would not be needed..
Something like

badpts = find_discontiguities(coord)
points = ma.masked_array(coord.points)
points[badpts] = ma.masked
coord.points = points

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

A boolean array would be fine for this because we don't need anything to be human-readable; we are just doing operations. But I still disagree with creating a boolean array for the previous.

@corinnebosley corinnebosley Aug 17, 2018

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Also what do you mean by 'this routine would not be needed?'

This routine is pretty much as simple as it gets. The whole point of having the two separate routines is that one allows you to check which points are discontiguous (as a human) and look at them and think about them, and the other allows you to just mask them without thought. Those are both valid options and it seems stupid to just not offer one of them because that's simpler.

# Construct an array the size of the points array filled with 'False'
# to represent an empty discontiguity array
self.empty_bool = np.zeros((self.lons.points.shape),
dtype=bool)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

E127 continuation line over-indented for visual indent

@corinnebosley

Copy link
Copy Markdown
Member Author

Changes following last review:

  • find_discontiguities now returns a boolean array, not a dictionary (although it was not simple, thank you very much)
  • make_bounds_discontiguous_at_point now broadcasts the discontiguity mask properly to handle cubes with more than 2 dimensions
  • mask_discontiguities also broadcasts the 2d mask to data arrays with more than 2 dimensions
  • temporary tests have been updated to check that the broadcasting works

@corinnebosley

Copy link
Copy Markdown
Member Author

@lbdreyer All tests passed. What do you think?

@lbdreyer lbdreyer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looking good! I have a few comments, mostly renaming things more descriptive names.

The tests are in a bit of a jumble. Maybe keep the old tests where they are (as I have moved them in the PR I am working on, but feel free to do so in this PR instead), but the new tests that are introduced in this PR (e.g. for find_discontiguities and mask_discontiguities) should go in the appropriate places

Comment thread lib/iris/plot.py
Comment thread lib/iris/plot.py Outdated

# If discontinuity occurs but not masked, any grid will be created
# incorrectly, so raise a warning
# incorrectly, so raise a warning for the user

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

You don't really need this clarification as all warnings are for the user

Comment thread lib/iris/plot.py Outdated
'Please use ' \
'iris.contiguity_check(coord) to find ' \
'and mask your data ' \
'appropriately'.format(coord.name())

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Don't you mean iris.util.find_discontiguities and iris.util.mask_discontiguities instead of iris.contiguity_check?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yep, this is leftover from before the full implementation.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Is this going to end up a bit long and rambly?

Comment thread lib/iris/plot.py Outdated
'iris.contiguity_check(coord) to find ' \
'and mask your data ' \
'appropriately'.format(coord.name())
warnings.warn(discontiguity_warning)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We have chosen to raise this as an error but I make that change in the next PR so we'll leave this as it is in this PR

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Ah. Good decision.

Comment thread lib/iris/util.py Outdated
try:
return bad_points_boolean
except ValueError:
return None

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I assume you forgot to remove this? Otherwise it will catch all errors which would working out what is going wrong difficult.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yes I did. I needed this for an earlier implementation but it will never return None now (unless it's broken), so you're quite right.

# awkward but supported cube.
cube = self.latlon_2d
result = iplt._draw_2d_from_bounds('pcolormesh', cube)
self.assertTrue(result)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

draw_2d_from_bounds is too complicated to unit test. I suggest you just remove this test.
I am in the process of adding an integration test that will test draw_2d_from_bounds (which will at the same time check that it is not raising an error)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah, this was meant as a placeholder really, I think it was one of the first tests I put in, just to help me think. I'll take it out.

Comment thread lib/iris/util.py Outdated
Copy of the data array, masked at points where bounds are
discontiguous.
"""
mask = find_discontiguities(coord, abs_tol=abs_tol)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

mask isn't that clear what it means as it doesn't refer to the cube's original mask, it refers to the locations of the discontiguities and so the new places that should be masked.
How about something like discontiguous_locations or discontiguous or discontiguous_bounds_locations... I can't really think of a good name.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Maybe just new_mask or extra_mask


with warnings.catch_warnings():
warnings.simplefilter("error")
with self.assertRaises(UserWarning):

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This really needs a assertRaisesRegexp to check it's getting the right warning`

self.empty_bool = np.zeros(self.lons.points.shape,
dtype=bool)
self.masked = self.empty_bool.copy()
self.masked[3, 3] = True

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Why not just use the mask of self.latlon_2d?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

And unmask it first? I suppose so. Don't see that it makes a lot of difference but I'll pop it in anyway.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Oh no wait a minute, I'm not quite sure what I'm actually trying to achieve here, maybe I need to think about this a bit more and add some comments.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think I will need the array of Falses that I construct here because that's the easiest way to do it, but there is no need to then mask the single point I have done here. I can just use the cube's mask instead of constructing self.masked.

def setUp(self):
self.latlon_2d = full2d_global()
make_bounds_discontiguous_at_point(self.latlon_2d, 3, 2)
self.lons = self.latlon_2d.coord('longitude')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'd prefer more descriptive names, it would make reading the test easier, so:
self.latlon_2d_cube and self.lons_coord


import numpy as np
import numpy.ma as ma
import warnings

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

F401 'warnings' imported but unused

import warnings

import iris.coords as coords
import iris.util

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

F401 'iris.util' imported but unused

# # with warnings.catch_warnings():
# # warnings.simplefilter("error")
# # with self.assertRaises(UserWarning):
# # iris.plot._check_bounds_contiguity_and_mask(coord, cube.data)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

E501 line too long (81 > 79 characters)

# Construct an array the size of the points array filled with 'False'
# to represent a mask showing no discontiguities
empty_mask = np.zeros(self.longitude_coord.points.shape,
dtype=bool)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

E127 continuation line over-indented for visual indent

Comment thread lib/iris/util.py Outdated

# Apply mask for x-direction discontiguities:
bad_points_boolean[:, :-1] = np.logical_or(bad_points_boolean[:, :-1],
gaps_x)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

E128 continuation line under-indented for visual indent

Comment thread lib/iris/util.py Outdated

# apply mask for y-direction discontiguities:
bad_points_boolean[:-1, :] = np.logical_or(bad_points_boolean[:-1, :],
gaps_y)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

E128 continuation line under-indented for visual indent

import iris.plot
import iris.tests as tests

import numpy as np

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

F401 'numpy as np' imported but unused


import iris.coords as coords
import iris.util
from iris.util import find_discontiguities_in_bounds

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

F401 'iris.util.find_discontiguities_in_bounds' imported but unused

import iris.coords as coords
import iris.util
from iris.util import find_discontiguities_in_bounds
from iris.util import mask_data_at_discontiguities

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

F401 'iris.util.mask_data_at_discontiguities' imported but unused

from iris.util import mask_data_at_discontiguities
from iris.tests.stock import simple_2d_w_multidim_coords as cube_2dcoords
from iris.tests.stock import simple_3d_w_multidim_coords as cube3d_2dcoords
from iris.tests.stock import simple_3d

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

F401 'iris.tests.stock.simple_3d' imported but unused

from iris.tests.stock import simple_3d
from iris.tests.stock import sample_2d_latlons
from iris.tests.stock import make_bounds_discontiguous_at_point
from iris.tests.stock._stock_2d_latlons import grid_coords_2d_from_1d

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

F401 'iris.tests.stock._stock_2d_latlons.grid_coords_2d_from_1d' imported but unused

# Construct an array the size of the points array filled with 'False'
# to represent a mask showing no discontiguities
empty_mask = np.zeros(self.longitude_coord.points.shape,
dtype=bool)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

E127 continuation line over-indented for visual indent

@corinnebosley

Copy link
Copy Markdown
Member Author

Had some trouble with make_bounds_discontiguous_at_point here. If you use full2d_global (which is just sample_2d_latlons(transformed=True), some of the points become miniscule and therefore the differences between bottom-left bound and bottom-right bound are also miniscule.

I have been finding that many coordinate points from full2d_global (such as (0, 0) and (3, 2)) are so small that the discontiguity created by make_bounds_discontiguous_at_point is well below the default absolute tolerance in find_discontiguities_in_bounds.

This is possibly a good test for a relative tolerance option though...

@corinnebosley

Copy link
Copy Markdown
Member Author

@lbdreyer I'm slightly worried about bits still being a problem, particularly test data. But for now, I'm afraid this is the best you're gonna get. Thanks for all your help and good luck getting to the finish with this.

@pp-mo

pp-mo commented Aug 28, 2018

Copy link
Copy Markdown
Member

Hi @corinnebosley @lbdreyer
👍 for good stuff + progress made

However, discussing today with @lbdreyer I'm still not very sure about the API.
We could easily combine these two functions now.
Or, we could make the mask_data_at_discontiguities routine into a more general "apply_mask" operation. But in that case it should really work with a general mask input, for which purpose a boolean array is not good because the dimensions to apply it to are unknown.
So actually, ideally, I think that the main "find_discontiguities.." result should be wrapped as a cube containing coords, so that the 2d mask can be mapped to the dimensions it applies to.

It also seems to me that this should absolutely be checking both x- and y-coords of a given cube, or every use will be calling it twice ??

Rather more seriously ... I'm wondering now where + why we need this ??
If we haven't an immediate use within the collected test data, then I this this has to take low priority.
I'll go + have a look for any existing test data that needs it ...

@pp-mo

pp-mo commented Sep 5, 2018

Copy link
Copy Markdown
Member

@pp-mo Rather more seriously ... I'm wondering now where + why we need this

Forget that -- I found out why today !
Some data wouldn't plot. No easy means of working out why not, let alone fixing it.

@DPeterK DPeterK added this to the v2.2.0 milestone Oct 3, 2018
@DPeterK

DPeterK commented Oct 3, 2018

Copy link
Copy Markdown
Member

... and consider #3105 while getting this fixed.

@DPeterK DPeterK changed the base branch from 2d_coords to master October 3, 2018 09:49
…orking

pylint corrections, small corrections to zip nightmare and return format

corrections for Laura

reinstated imports of six that pycharm keeps secretly changing

some changes on Laura's suggestions, more to come

pylint changes

more stickler requested changes (not pylint at all)

some fixes and tweaks
@corinnebosley corinnebosley force-pushed the public_contiguity_checking branch from 582c164 to 29d0e95 Compare October 3, 2018 13:21

@pp-mo pp-mo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Bunch of trivial points !!

Comment thread lib/iris/tests/stock/_stock_2d_latlons.py Outdated
Comment thread lib/iris/tests/stock/_stock_2d_latlons.py Outdated
Comment thread lib/iris/tests/stock/_stock_2d_latlons.py
Comment thread lib/iris/tests/unit/plot/test__check_bounds_contiguity_and_mask.py Outdated
Comment thread lib/iris/tests/unit/plot/test__check_bounds_contiguity_and_mask.py Outdated
Comment thread lib/iris/util.py
Comment thread lib/iris/util.py Outdated
Comment thread lib/iris/util.py Outdated
Comment thread lib/iris/util.py Outdated
Comment thread lib/iris/util.py Outdated
Comment thread lib/iris/coords.py Outdated
@corinnebosley corinnebosley dismissed lbdreyer’s stale review October 10, 2018 09:08

PR moved on since suggested changes (some changes made, others discarded)

Comment thread lib/iris/coords.py Outdated
rtol * cell_size)

points_close_enough = (diffs_along_axis <= (atol +
rtol * (lower_bounds - upper_bounds)))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

E128 continuation line under-indented for visual indent

@corinnebosley

Copy link
Copy Markdown
Member Author

@pp-mo Still have to remove all references to discontiguity from iris.util.mask_cube. Sorry, forgot...

@corinnebosley

Copy link
Copy Markdown
Member Author

@pp-mo I have now removed all references to discontiguity in iris.util.mask_cube, but I'd like you to check the words in the docstring for me please because I'm not sure if they're quite right.

Thanks!

@pp-mo

pp-mo commented Oct 10, 2018

Copy link
Copy Markdown
Member

iris.util.mask_cube ... I'd like you to check the words in the docstring

Looks fine to me 😃 !

Test discontiguity checking for a y-direction mismatch.
@DPeterK DPeterK mentioned this pull request Oct 10, 2018
13 tasks
Comment thread lib/iris/util.py
Comment thread lib/iris/util.py

@lbdreyer lbdreyer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I've been getting lots of notifications from this PR so I couldn't help but have a very very quick look, as I was interested in what the API would look like.

I have a couple quick comments about doc strings.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants