Skip to content

Commit 861f7c5

Browse files
committed
Fixing long lines
1 parent 2ad0b5c commit 861f7c5

File tree

2 files changed

+10
-16
lines changed

2 files changed

+10
-16
lines changed

lib/iris/coords.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,8 @@ def __getitem__(self, keys):
497497
if bounds is not None:
498498
bounds = bounds.copy()
499499

500-
# The new coordinate is a copy of the old one with replaced content.
500+
# The new coordinate is a copy of the old one with replaced
501+
# content.
501502
new_coord = self.copy(points=points, bounds=bounds)
502503
return new_coord
503504

lib/iris/tests/test_analysis.py

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -313,27 +313,18 @@ def test_sum(self):
313313
class TestAuxCoordCollapse(tests.IrisTest):
314314

315315
def setUp(self):
316-
from iris.analysis.cartography import area_weights
317316
self.cube_with_aux_coord = tests.stock.simple_4d_with_hybrid_height()
318317

319318
# Guess bounds to get the weights
320319
self.cube_with_aux_coord.coord('grid_latitude').guess_bounds()
321320
self.cube_with_aux_coord.coord('grid_longitude').guess_bounds()
322321

323-
self.weights = area_weights(self.cube_with_aux_coord, normalize=False)
324-
self.normalized_weights = area_weights(self.cube_with_aux_coord, normalize=True)
325-
326-
self.original_alt = self.cube_with_aux_coord.coord('altitude')
327-
# [[100, 101, 102, 103, 104, 105],
328-
# [106, 107, 108, 109, 110, 111],
329-
# [112, 113, 114, 115, 116, 117],
330-
# [118, 119, 120, 121, 122, 123],
331-
# [124, 125, 126, 127, 128, 129]]
332-
333322
def test_max(self):
334-
cube = self.cube_with_aux_coord.collapsed('grid_latitude', iris.analysis.MAX)
323+
cube = self.cube_with_aux_coord.collapsed('grid_latitude',
324+
iris.analysis.MAX)
335325
np.testing.assert_array_equal(cube.coord('surface_altitude').points,
336-
np.array([112, 113, 114, 115, 116, 117]))
326+
np.array([112, 113, 114,
327+
115, 116, 117]))
337328

338329
np.testing.assert_array_equal(cube.coord('surface_altitude').bounds,
339330
np.array([[100, 124],
@@ -344,15 +335,17 @@ def test_max(self):
344335
[105, 129]]))
345336

346337
# Check collapsing over the whole coord still works
347-
cube = self.cube_with_aux_coord.collapsed('altitude', iris.analysis.MAX)
338+
cube = self.cube_with_aux_coord.collapsed('altitude',
339+
iris.analysis.MAX)
348340

349341
np.testing.assert_array_equal(cube.coord('surface_altitude').points,
350342
np.array([114]))
351343

352344
np.testing.assert_array_equal(cube.coord('surface_altitude').bounds,
353345
np.array([[100, 129]]))
354346

355-
cube = self.cube_with_aux_coord.collapsed('grid_longitude', iris.analysis.MAX)
347+
cube = self.cube_with_aux_coord.collapsed('grid_longitude',
348+
iris.analysis.MAX)
356349

357350
np.testing.assert_array_equal(cube.coord('surface_altitude').points,
358351
np.array([102, 108, 114, 120, 126]))

0 commit comments

Comments
 (0)