@@ -341,22 +341,31 @@ def test_inconsistent_shape(self):
341341
342342 def test_axis_out_of_bounds_fz_src_relative (self ):
343343 # axis is out of bounds as identified by the absolute axis with z_src.
344- data = np .empty ([ 5 , 4 ] )
345- zdata = np .empty ([ 5 , 4 ] )
344+ data = np .empty (( 5 , 4 ) )
345+ zdata = np .empty (( 5 , 4 ) )
346346 axis = 4
347347 emsg = 'Axis {} out of range'
348348 with self .assertRaisesRegexp (ValueError , emsg .format (axis )):
349349 vinterp ._Interpolation ([1 , 3 ], data , zdata , axis = axis )
350350
351351 def test_axis_out_of_bounds_z_src_absolute (self ):
352352 # axis is out of bounds as identified by the relative axis with fz_src.
353- data = np .empty ([ 5 , 4 ] )
354- zdata = np .empty ([ 3 , 5 , 4 ] )
353+ data = np .empty (( 5 , 4 ) )
354+ zdata = np .empty (( 3 , 5 , 4 ) )
355355 axis = 0
356356 emsg = 'Axis {} out of range'
357357 with self .assertRaisesRegexp (ValueError , emsg .format (axis )):
358358 vinterp ._Interpolation ([1 , 3 ], data , zdata , axis = axis )
359359
360+ def test_axis_greater_than_z_src_ndim (self ):
361+ # Ensure that axis is not unnecessarily constrained to the dimensions
362+ # of z_src.
363+ data = np .empty ((4 ))
364+ zdata = np .empty ((3 , 5 , 4 ))
365+ axis = 2
366+ result = vinterp ._Interpolation (data .copy (), data , zdata , axis = axis )
367+ self .assertEqual (result .result_shape , (3 , 5 , 4 ))
368+
360369 def test_nd_inconsistent_ndims (self ):
361370 z_target = np .empty ((2 , 3 , 4 ))
362371 z_src = np .empty ((3 , 4 ))
0 commit comments