spatial.tests.test_distance

Module Contents

Functions

load_testing_files()
_chk_asarrays(arrays,axis=None)
_chk_weights(arrays,weights=None,axis=None,force_weights=False,simplify_weights=True,pos_only=False,neg_check=False,nan_screen=False,mask_screen=False,ddof=None)
_freq_weights(weights)
_weight_masked(arrays,weights,axis)
within_tol(a,b,tol)
_assert_within_tol(a,b,atol=0,rtol=0,verbose_=False)
_rand_split(arrays,weights,axis,split_per,seed=None)
_rough_check(a,b,compare_assert=partial,key=None,w=None)
_weight_checked(fn,n_args=2,default_axis=None,key=None,weight_arg=”w”,squeeze=True,silent=False,ones_test=True,const_test=True,dup_test=True,split_test=True,dud_test=True,ma_safe=False,ma_very_safe=False,nan_safe=False,split_per=1.0,seed=0,compare_assert=partial) runs fn on its arguments 2 or 3 ways, checks that the results are the same,
is_valid_dm_throw(D)
is_valid_y_throw(y)
test_bad_p()
test_sokalsneath_all_false()
test_canberra()
test_braycurtis()
test_euclideans()
test_hamming_unequal_length()
test_hamming_string_array()
test_minkowski_w()
test_sqeuclidean_dtypes()
test_sokalmichener()
test_modifies_input()
test_Xdist_deprecated_args()
test__validate_vector()
load_testing_files()
_chk_asarrays(arrays, axis=None)
_chk_weights(arrays, weights=None, axis=None, force_weights=False, simplify_weights=True, pos_only=False, neg_check=False, nan_screen=False, mask_screen=False, ddof=None)
_freq_weights(weights)
_weight_masked(arrays, weights, axis)
within_tol(a, b, tol)
_assert_within_tol(a, b, atol=0, rtol=0, verbose_=False)
_rand_split(arrays, weights, axis, split_per, seed=None)
_rough_check(a, b, compare_assert=partial, key=None, w=None)
_weight_checked(fn, n_args=2, default_axis=None, key=None, weight_arg="w", squeeze=True, silent=False, ones_test=True, const_test=True, dup_test=True, split_test=True, dud_test=True, ma_safe=False, ma_very_safe=False, nan_safe=False, split_per=1.0, seed=0, compare_assert=partial)

runs fn on its arguments 2 or 3 ways, checks that the results are the same, then returns the same thing it would have returned before

class TestCdist
setup_method()
test_cdist_extra_args()
test_cdist_euclidean_random_unicode()
test_cdist_minkowski_random_p3d8()
test_cdist_minkowski_random_p4d6()
test_cdist_minkowski_random_p1d23()
test_cdist_cosine_random()
test_cdist_mahalanobis()
test_cdist_custom_notdouble()
_check_calling_conventions(X1, X2, metric, eps=1e-07, **kwargs)
test_cdist_calling_conventions()
test_cdist_dtype_equivalence()
test_cdist_out()
class TestPdist
setup_method()
test_pdist_extra_args()
test_pdist_euclidean_random()
test_pdist_euclidean_random_u()
test_pdist_euclidean_random_float32()
test_pdist_euclidean_random_nonC()
test_pdist_euclidean_iris_double()
test_pdist_euclidean_iris_float32()
test_pdist_euclidean_iris_nonC()
test_pdist_seuclidean_random()
test_pdist_seuclidean_random_float32()
test_pdist_seuclidean_random_nonC()
test_pdist_seuclidean_iris()
test_pdist_seuclidean_iris_float32()
test_pdist_seuclidean_iris_nonC()
test_pdist_cosine_random()
test_pdist_cosine_random_float32()
test_pdist_cosine_random_nonC()
test_pdist_cosine_iris()
test_pdist_cosine_iris_float32()
test_pdist_cosine_iris_nonC()
test_pdist_cosine_bounds()
test_pdist_cityblock_random()
test_pdist_cityblock_random_float32()
test_pdist_cityblock_random_nonC()
test_pdist_cityblock_iris()
test_pdist_cityblock_iris_float32()
test_pdist_cityblock_iris_nonC()
test_pdist_correlation_random()
test_pdist_correlation_random_float32()
test_pdist_correlation_random_nonC()
test_pdist_correlation_iris()
test_pdist_correlation_iris_float32()
test_pdist_correlation_iris_nonC()
test_pdist_minkowski_random()
test_pdist_minkowski_random_float32()
test_pdist_minkowski_random_nonC()
test_pdist_minkowski_3_2_iris()
test_pdist_minkowski_3_2_iris_float32()
test_pdist_minkowski_3_2_iris_nonC()
test_pdist_minkowski_5_8_iris()
test_pdist_minkowski_5_8_iris_float32()
test_pdist_minkowski_5_8_iris_nonC()
test_pdist_mahalanobis()
test_pdist_hamming_random()
test_pdist_hamming_random_float32()
test_pdist_hamming_random_nonC()
test_pdist_dhamming_random()
test_pdist_dhamming_random_float32()
test_pdist_dhamming_random_nonC()
test_pdist_jaccard_random()
test_pdist_jaccard_random_float32()
test_pdist_jaccard_random_nonC()
test_pdist_djaccard_random()
test_pdist_djaccard_random_float32()
test_pdist_djaccard_random_nonC()
test_pdist_chebyshev_random()
test_pdist_chebyshev_random_float32()
test_pdist_chebyshev_random_nonC()
test_pdist_chebyshev_iris()
test_pdist_chebyshev_iris_float32()
test_pdist_chebyshev_iris_nonC()
test_pdist_matching_mtica1()
test_pdist_matching_mtica2()
test_pdist_jaccard_mtica1()
test_pdist_jaccard_mtica2()
test_pdist_yule_mtica1()
test_pdist_yule_mtica2()
test_pdist_dice_mtica1()
test_pdist_dice_mtica2()
test_pdist_sokalsneath_mtica1()
test_pdist_sokalsneath_mtica2()
test_pdist_rogerstanimoto_mtica1()
test_pdist_rogerstanimoto_mtica2()
test_pdist_russellrao_mtica1()
test_pdist_russellrao_mtica2()
test_pdist_canberra_match()
test_pdist_canberra_ticket_711()
test_pdist_custom_notdouble()
_check_calling_conventions(X, metric, eps=1e-07, **kwargs)
test_pdist_calling_conventions()
test_pdist_dtype_equivalence()
test_pdist_out()
class TestSomeDistanceFunctions
setup_method()
test_minkowski()
test_old_wminkowski()
test_euclidean()
test_sqeuclidean()
test_cosine()
test_correlation()
test_mahalanobis()
class TestSquareForm
test_squareform_matrix()
test_squareform_vector()
check_squareform_matrix(dtype)
check_squareform_vector(dtype)
test_squareform_multi_matrix()
check_squareform_multi_matrix(n)
class TestNumObsY
test_num_obs_y_multi_matrix()
test_num_obs_y_1()
test_num_obs_y_2()
test_num_obs_y_3()
test_num_obs_y_4()
test_num_obs_y_5_10()
test_num_obs_y_2_100()
minit(n)
bad_y(n)
check_y(n)
make_y(n)
class TestNumObsDM
test_num_obs_dm_multi_matrix()
test_num_obs_dm_0()
test_num_obs_dm_1()
test_num_obs_dm_2()
test_num_obs_dm_3()
test_num_obs_dm_4()
check_D(n)
make_D(n)
is_valid_dm_throw(D)
class TestIsValidDM
test_is_valid_dm_improper_shape_1D_E()
test_is_valid_dm_improper_shape_1D_F()
test_is_valid_dm_improper_shape_3D_E()
test_is_valid_dm_improper_shape_3D_F()
test_is_valid_dm_nonzero_diagonal_E()
test_is_valid_dm_nonzero_diagonal_F()
test_is_valid_dm_asymmetric_E()
test_is_valid_dm_asymmetric_F()
test_is_valid_dm_correct_1_by_1()
test_is_valid_dm_correct_2_by_2()
test_is_valid_dm_correct_3_by_3()
test_is_valid_dm_correct_4_by_4()
test_is_valid_dm_correct_5_by_5()
is_valid_y_throw(y)
class TestIsValidY
test_is_valid_y_improper_shape_2D_E()
test_is_valid_y_improper_shape_2D_F()
test_is_valid_y_improper_shape_3D_E()
test_is_valid_y_improper_shape_3D_F()
test_is_valid_y_correct_2_by_2()
test_is_valid_y_correct_3_by_3()
test_is_valid_y_correct_4_by_4()
test_is_valid_y_correct_5_by_5()
test_is_valid_y_2_100()
bad_y(n)
correct_n_by_n(n)
test_bad_p()
test_sokalsneath_all_false()
test_canberra()
test_braycurtis()
test_euclideans()
test_hamming_unequal_length()
test_hamming_string_array()
test_minkowski_w()
test_sqeuclidean_dtypes()
test_sokalmichener()
test_modifies_input()
test_Xdist_deprecated_args()
test__validate_vector()