@@ -496,6 +496,56 @@ def test_string_nd_second(self):
496496
497497 self .assertArrayEqual (collapsed_coord .points , expected )
498498
499+ def test_string_nd_bounds_first (self ):
500+ self .setupTestArrays ((3 , 4 ))
501+ coord = AuxCoord (
502+ self .pts_real .astype (str ), bounds = self .bds_real .astype (str )
503+ )
504+
505+ collapsed_coord = coord .collapsed (0 )
506+
507+ # Points handling is as for non bounded case. So just check bounds.
508+ expected_lower = [
509+ "-2.0|38.0|78.0" ,
510+ "8.0|48.0|88.0" ,
511+ "18.0|58.0|98.0" ,
512+ "28.0|68.0|108.0" ,
513+ ]
514+
515+ expected_upper = [
516+ "2.0|42.0|82.0" ,
517+ "12.0|52.0|92.0" ,
518+ "22.0|62.0|102.0" ,
519+ "32.0|72.0|112.0" ,
520+ ]
521+
522+ self .assertArrayEqual (collapsed_coord .bounds [:, 0 ], expected_lower )
523+ self .assertArrayEqual (collapsed_coord .bounds [:, 1 ], expected_upper )
524+
525+ def test_string_nd_bounds_second (self ):
526+ self .setupTestArrays ((3 , 4 ))
527+ coord = AuxCoord (
528+ self .pts_real .astype (str ), bounds = self .bds_real .astype (str )
529+ )
530+
531+ collapsed_coord = coord .collapsed (1 )
532+
533+ # Points handling is as for non bounded case. So just check bounds.
534+ expected_lower = [
535+ "-2.0|8.0|18.0|28.0" ,
536+ "38.0|48.0|58.0|68.0" ,
537+ "78.0|88.0|98.0|108.0" ,
538+ ]
539+
540+ expected_upper = [
541+ "2.0|12.0|22.0|32.0" ,
542+ "42.0|52.0|62.0|72.0" ,
543+ "82.0|92.0|102.0|112.0" ,
544+ ]
545+
546+ self .assertArrayEqual (collapsed_coord .bounds [:, 0 ], expected_lower )
547+ self .assertArrayEqual (collapsed_coord .bounds [:, 1 ], expected_upper )
548+
499549
500550class Test_is_compatible (tests .IrisTest ):
501551 def setUp (self ):
0 commit comments