def test_extract_array_1d_odd():
 assert np.all((extract_array(np.arange(4), (3,), ((-1),), fill_value=(-99)) == np.array([(-99), (-99), 0])))
 assert np.all((extract_array(np.arange(4), (3,), (0,), fill_value=(-99)) == np.array([(-99), 0, 1])))
 for i in [1, 2]:
  assert np.all((extract_array(np.arange(4), (3,), (i,)) == np.array([(i - 1), i, (i + 1)])))
 assert np.all((extract_array(np.arange(4), (3,), (3,), fill_value=(-99)) == np.array([2, 3, (-99)])))
 arrayin = np.arange(4.0)
 extracted = extract_array(arrayin, (3,), (4,))
 assert (extracted[0] == 3)
 assert np.isnan(extracted[1])
 assert (extracted.dtype == arrayin.dtype)

def test_extract_array_1d_odd ( ) : assert np . all ( ( extract_array ( np . arange ( 4 ) , ( 3 , ) , ( ( - 1 ) , ) , fill_value = ( - 99 ) ) == np . array ( [ ( - 99 ) , ( - 99 ) , 0 ] ) ) ) assert np . all ( ( extract_array ( np . arange ( 4 ) , ( 3 , ) , ( 0 , ) , fill_value = ( - 99 ) ) == np . array ( [ ( - 99 ) , 0 , 1 ] ) ) ) for i in [ 1 , 2 ] : assert np . all ( ( extract_array ( np . arange ( 4 ) , ( 3 , ) , ( i , ) ) == np . array ( [ ( i - 1 ) , i , ( i + 1 ) ] ) ) ) assert np . all ( ( extract_array ( np . arange ( 4 ) , ( 3 , ) , ( 3 , ) , fill_value = ( - 99 ) ) == np . array ( [ 2 , 3 , ( - 99 ) ] ) ) ) arrayin = np . arange ( 4.0 ) extracted = extract_array ( arrayin , ( 3 , ) , ( 4 , ) ) assert ( extracted [ 0 ] == 3 ) assert np . isnan ( extracted [ 1 ] ) assert ( extracted . dtype == arrayin . dtype )
extract 1 d arrays .