3434 data [f"feature_{ ii } " ] = [* test_features [:, ii ], * ctrl_features [:, ii ]]
3535
3636
37- def test_mahalonobis_dist ():
38- nbrs = aim ._mahalonobis_dist (test_features , ctrl_features )
37+ def test_mahalanobis_dist ():
38+ nbrs = aim ._mahalanobis_dist (test_features , ctrl_features )
3939
4040 v_inv = np .linalg .inv (
4141 np .cov (np .concatenate ((test_features , ctrl_features ), axis = 0 ).T , ddof = 0 )
@@ -48,8 +48,8 @@ def test_mahalonobis_dist():
4848 assert_array_almost_equal (nbrs , nbrs_scipy )
4949
5050
51- def test_mahalonobis_dist_match_df ():
52- matched_df = aim .mahalonobis_dist_match (
51+ def test_mahalanobis_dist_match_df ():
52+ matched_df = aim .mahalanobis_dist_match (
5353 data = data ,
5454 status_col = "status" ,
5555 feature_cols = ["feature_0" , "feature_1" , "feature_2" , "feature_3" ],
@@ -64,16 +64,16 @@ def test_mahalonobis_dist_match_df():
6464 )
6565
6666
67- def test_mahalonobis_dist_match_df_err ():
67+ def test_mahalanobis_dist_match_df_err ():
6868 with pytest .raises (ValueError ): # no status column
69- aim .mahalonobis_dist_match (data = data )
69+ aim .mahalanobis_dist_match (data = data )
7070 with pytest .raises (ValueError ): # status has more than two unique values
71- aim .mahalonobis_dist_match (data = data , status_col = "feature_0" )
71+ aim .mahalanobis_dist_match (data = data , status_col = "feature_0" )
7272
7373
74- def test_mahalonobis_dist_match_df_feauture_none ():
74+ def test_mahalanobis_dist_match_df_feauture_none ():
7575 data_wo_extras = data .drop (columns = ["eid" , "age" ])
76- matched_df = aim .mahalonobis_dist_match (
76+ matched_df = aim .mahalanobis_dist_match (
7777 data = data_wo_extras ,
7878 status_col = "status" ,
7979 threshold = 1 ,
@@ -87,8 +87,8 @@ def test_mahalonobis_dist_match_df_feauture_none():
8787 )
8888
8989
90- def test_mahalonobis_dist_match ():
91- matched_df = aim .mahalonobis_dist_match (
90+ def test_mahalanobis_dist_match ():
91+ matched_df = aim .mahalanobis_dist_match (
9292 test = test_features , ctrl = ctrl_features , threshold = 1
9393 )
9494
@@ -103,10 +103,10 @@ def test_mahalonobis_dist_match():
103103 )
104104
105105
106- def test_mahalonobis_dist_match_err ():
106+ def test_mahalanobis_dist_match_err ():
107107 with pytest .raises (ValueError ): # test if nan error is raised
108108 test_features_with_nans = test_features .copy ()
109109 test_features_with_nans [0 , 2 ] = np .nan
110- aim .mahalonobis_dist_match (
110+ aim .mahalanobis_dist_match (
111111 test = test_features_with_nans , ctrl = ctrl_features , threshold = 1
112112 )
0 commit comments