@testing.requires_testing_data
def test_len_index_dipoles():
 dipole = read_dipole(fname_dip)
 d0 = dipole[0]
 d1 = dipole[:1]
 _check_dipole(d0, 1)
 _check_dipole(d1, 1)
 _compare_dipoles(d0, d1)
 mask = (dipole.gof > 15)
 idx = np.where(mask)[0]
 d_mask = dipole[mask]
 _check_dipole(d_mask, 4)
 _compare_dipoles(d_mask, dipole[idx])

@ testing . requires_testing_data def test_len_index_dipoles ( ) : dipole = read_dipole ( fname_dip ) d0 = dipole [ 0 ] d1 = dipole [ : 1 ] _check_dipole ( d0 , 1 ) _check_dipole ( d1 , 1 ) _compare_dipoles ( d0 , d1 ) mask = ( dipole . gof > 15 ) idx = np . where ( mask ) [ 0 ] d_mask = dipole [ mask ] _check_dipole ( d_mask , 4 ) _compare_dipoles ( d_mask , dipole [ idx ] )
test len and indexing of dipole objects .