File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
lib/iris/tests/unit/coords Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -469,6 +469,33 @@ def test_lazy_nd_points_and_bounds(self):
469469 self .assertArrayEqual (collapsed_coord .points , da .array ([55 ]))
470470 self .assertArrayEqual (collapsed_coord .bounds , da .array ([[- 2 , 112 ]]))
471471
472+ def test_string_nd_first (self ):
473+ self .setupTestArrays ((3 , 4 ))
474+ coord = AuxCoord (self .pts_real .astype (str ))
475+
476+ collapsed_coord = coord .collapsed (0 )
477+ expected = [
478+ "0.0|40.0|80.0" ,
479+ "10.0|50.0|90.0" ,
480+ "20.0|60.0|100.0" ,
481+ "30.0|70.0|111.0" ,
482+ ]
483+
484+ self .assertArrayEqual (collapsed_coord .points , expected )
485+
486+ def test_string_nd_second (self ):
487+ self .setupTestArrays ((3 , 4 ))
488+ coord = AuxCoord (self .pts_real .astype (str ))
489+
490+ collapsed_coord = coord .collapsed (1 )
491+ expected = [
492+ "0.0|10.0|20.0|30.0" ,
493+ "40.0|50.0|60.0|70.0" ,
494+ "80.0|90.0|100.0|110.0" ,
495+ ]
496+
497+ self .assertArrayEqual (collapsed_coord .points , expected )
498+
472499
473500class Test_is_compatible (tests .IrisTest ):
474501 def setUp (self ):
You can’t perform that action at this time.
0 commit comments