@@ -313,27 +313,18 @@ def test_sum(self):
313313class 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