Skip to content

Commit 17974e2

Browse files
pp-moznicholls
authored andcommitted
Pin Dask to avoid 0.18.2 bug with masked arrays. (SciTools#3127)
* Put orca_util routines in subpackage of iris.test.stock, to get existing iris.tests.unit.plot.test_2d_coords working. * Disable broken misused testcode in test_gridcell_angles. * Ditch test_gridcell_angles, none of it is functional. * Further style fixes. * Skip tests using iris-test-data, for Travis TEST_MINIMAL phases. * Codestyle fix (though this code obsolete anyway). * Fix unused imports. * Made-up test cube replaces use of iris-test-data. * Renamed keyword; improved docstring. * Change 'co' to 'coord' for clarity. * Review changes.
1 parent adf3dae commit 17974e2

8 files changed

Lines changed: 382 additions & 417 deletions

File tree

lib/iris/analysis/_grid_angles.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def _angle(p, q, r):
9292
if old_style:
9393
mid_lons = np.deg2rad(q[0])
9494

95-
pr = _3d_xyz_from_latlon(r[0], r[1]) - _3d_xyz_from_latlon(p[0], p[1])
95+
pr = _3d_xyz_from_latlon(r[0], r[1]) - _3d_xyz_from_latlon(p[0], p[1])
9696
pr_norm = np.sqrt(np.sum(pr**2, axis=0))
9797
pr_top = pr[1] * np.cos(mid_lons) - pr[0] * np.sin(mid_lons)
9898

@@ -124,7 +124,7 @@ def _angle(p, q, r):
124124
lmb_hatvec_y,
125125
lmb_hatvec_z)])
126126

127-
pr = _3d_xyz_from_latlon(r[0], r[1]) - _3d_xyz_from_latlon(p[0], p[1])
127+
pr = _3d_xyz_from_latlon(r[0], r[1]) - _3d_xyz_from_latlon(p[0], p[1])
128128

129129
# Dot products to form true-northward / true-eastward projections.
130130
pr_cmpt_e = np.sum(pr * lmb_hatvec, axis=0)
@@ -141,7 +141,7 @@ def _angle(p, q, r):
141141
rtol = 1.e-3
142142
check = np.allclose(mag_rot, mag_orig, rtol=rtol)
143143
if not check:
144-
print (mag_rot, mag_orig)
144+
print(mag_rot, mag_orig)
145145
assert np.allclose(mag_rot, mag_orig, rtol=rtol)
146146

147147
return psi

lib/iris/coords.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1071,7 +1071,7 @@ def is_contiguous(self, rtol=1e-05, atol=1e-08):
10711071
rtol=rtol, atol=atol)
10721072
elif self.ndim == 2:
10731073
contiguous, _, _ = _discontiguity_in_2d_bounds(self.bounds,
1074-
abs_tol=atol)
1074+
abs_tol=atol)
10751075
else:
10761076
contiguous = False
10771077
return contiguous

lib/iris/plot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ def _draw_2d_from_bounds(draw_method_name, cube, *args, **kwargs):
334334
plot_defn = _get_plot_defn(cube, mode, ndims=2)
335335

336336
twodim_contig_atol = kwargs.pop('two_dim_coord_contiguity_atol',
337-
1e-4)
337+
1e-4)
338338
for coord in plot_defn.coords:
339339
if hasattr(coord, 'has_bounds'):
340340
if coord.ndim == 2 and coord.has_bounds():
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
from iris.coords import DimCoord, AuxCoord
3737
import iris.tests as tests
3838
from iris.coord_systems import GeogCS, RotatedGeogCS
39-
39+
from ._stock_2d_latlons import (sample_2d_latlons,
40+
make_bounds_discontiguous_at_point)
4041

4142
def lat_lon_cube():
4243
"""

0 commit comments

Comments
 (0)