def test_slices_partial_overlap():
 temp = overlap_slices((5,), (3,), (0,))
 assert (temp == ((slice(0, 2, None),), (slice(1, 3, None),)))
 temp = overlap_slices((5,), (3,), (0,), mode=u'partial')
 assert (temp == ((slice(0, 2, None),), (slice(1, 3, None),)))
 for pos in [0, 4]:
  with pytest.raises(PartialOverlapError) as e:
   temp = overlap_slices((5,), (3,), (pos,), mode=u'strict')
  assert (u'Arrays overlap only partially.' in str(e.value))

def test_slices_partial_overlap ( ) : temp = overlap_slices ( ( 5 , ) , ( 3 , ) , ( 0 , ) ) assert ( temp == ( ( slice ( 0 , 2 , None ) , ) , ( slice ( 1 , 3 , None ) , ) ) ) temp = overlap_slices ( ( 5 , ) , ( 3 , ) , ( 0 , ) , mode = u'partial' ) assert ( temp == ( ( slice ( 0 , 2 , None ) , ) , ( slice ( 1 , 3 , None ) , ) ) ) for pos in [ 0 , 4 ] : with pytest . raises ( PartialOverlapError ) as e : temp = overlap_slices ( ( 5 , ) , ( 3 , ) , ( pos , ) , mode = u'strict' ) assert ( u'Arrays overlap only partially.' in str ( e . value ) )
compute a slice for partially overlapping arrays .