@@ -15,15 +15,16 @@ def _testcube(self, z=1, name="this", dataless=False):
1515 # Create a testcube with a scalar Z coord, for merge testing.
1616 cube = Cube (
1717 [1 , 2 , 3 ],
18+ long_name = name ,
1819 dim_coords_and_dims = [(DimCoord ([0.0 , 1.0 , 2 ], long_name = "x" ), 0 )],
1920 aux_coords_and_dims = [(AuxCoord ([z ], long_name = "z" ), ())],
2021 )
2122 if dataless :
2223 cube .data = None
2324 return cube
2425
25- def test_general_nomerge (self ):
26- # Check that normal merge works OK with dataless cubes included
26+ def test_mixed_passthrough (self ):
27+ # Check that normal merge can handle dataless alongside dataful cubes.
2728 cubes = CubeList (
2829 [
2930 self ._testcube (name = "this" , dataless = False ),
@@ -34,17 +35,19 @@ def test_general_nomerge(self):
3435 assert len (result ) == 2
3536 cube1 , cube2 = [result .extract_cube (name ) for name in ("this" , "that" )]
3637 assert not cube1 .is_dataless ()
37- assert cube1 .is_dataless ()
38+ assert cube2 .is_dataless ()
3839
3940 def test_dataless_merge (self ):
40- # Check that dataless cubes can be merged correctly .
41+ # Check that dataless cubes can be merged.
4142 cubes = CubeList (
4243 [
4344 self ._testcube (z = 1 , dataless = True ),
4445 self ._testcube (z = 2 , dataless = True ),
4546 ]
4647 )
47- cube = cubes .merge_cube ()
48+ cubes = cubes .merge ()
49+ assert len (cubes ) == 2
50+ (cube , cube2 ) = cubes
4851 assert cube .is_dataless ()
4952 assert np .all (cube .coord ("z" ).points == [1 , 2 ])
5053
0 commit comments