@@ -522,7 +522,7 @@ def test_pedigree_kinship__Hamilton_Kerr_compress_parent_dimension(
522
522
ds1 ["parent" ] = dims , parent
523
523
ds1 ["stat_Hamilton_Kerr_tau" ] = dims , tau
524
524
ds1 ["stat_Hamilton_Kerr_lambda" ] = dims , lambda_
525
- ds1 ["founder_kinship" ] = ["founders " , "founders " ], founder_kinship
525
+ ds1 ["founder_kinship" ] = ["founders_1 " , "founders_2 " ], founder_kinship
526
526
ds1 ["founder_indices" ] = ["founders" ], founder_indices
527
527
# test case with parents dim length > 2
528
528
parent , tau , lambda_ = widen_parent_arrays (
@@ -532,9 +532,9 @@ def test_pedigree_kinship__Hamilton_Kerr_compress_parent_dimension(
532
532
ds2 ["parent" ] = dims , parent
533
533
ds2 ["stat_Hamilton_Kerr_tau" ] = dims , tau
534
534
ds2 ["stat_Hamilton_Kerr_lambda" ] = dims , lambda_
535
- ds2 ["founder_kinship" ] = ["founders " , "founders " ], founder_kinship
535
+ ds2 ["founder_kinship" ] = ["founders_1 " , "founders_2 " ], founder_kinship
536
536
ds2 ["founder_indices" ] = ["founders" ], founder_indices
537
- assert (ds1 .dims ["parents" ], ds2 .dims ["parents" ]) == (2 , n_parent )
537
+ assert (ds1 .sizes ["parents" ], ds2 .sizes ["parents" ]) == (2 , n_parent )
538
538
# collect method arguments
539
539
kwargs = dict (method = "Hamilton-Kerr" , allow_half_founders = n_half_founder > 0 )
540
540
if use_founder_kinship :
@@ -619,7 +619,7 @@ def test_pedigree_kinship__raise_on_half_founder(method, initial_kinship, parent
619
619
ds ["stat_Hamilton_Kerr_tau" ] = xr .ones_like (ds ["parent_id" ], dtype = np .uint8 )
620
620
ds ["stat_Hamilton_Kerr_lambda" ] = xr .zeros_like (ds ["parent_id" ], dtype = float )
621
621
if initial_kinship :
622
- ds ["founder_kinship" ] = ["founders " , "founders " ], [[0.5 , 0.0 ], [0.0 , 0.5 ]]
622
+ ds ["founder_kinship" ] = ["founders_1 " , "founders_2 " ], [[0.5 , 0.0 ], [0.0 , 0.5 ]]
623
623
ds ["founder_indices" ] = ["founders" ], [0 , 1 ]
624
624
kwargs = dict (
625
625
founder_kinship = "founder_kinship" , founder_indices = "founder_indices"
@@ -641,7 +641,7 @@ def test_pedigree_kinship__diploid_raise_on_parent_dimension(use_founder_kinship
641
641
["S2" , "S3" , "." ],
642
642
]
643
643
if use_founder_kinship :
644
- ds ["founder_kinship" ] = ["founders " , "founders " ], [[0.5 , 0.0 ], [0.0 , 0.5 ]]
644
+ ds ["founder_kinship" ] = ["founders_1 " , "founders_2 " ], [[0.5 , 0.0 ], [0.0 , 0.5 ]]
645
645
ds ["founder_indices" ] = ["founders" ], [0 , 1 ]
646
646
kwargs = dict (
647
647
founder_kinship = "founder_kinship" , founder_indices = "founder_indices"
@@ -753,7 +753,7 @@ def test_pedigree_kinship__projection(
753
753
known_founder_kinship = ds_full .stat_pedigree_kinship .values [
754
754
unknown_founder_idx , :
755
755
][:, unknown_founder_idx ]
756
- ds_known ["founder_kinship" ] = ["founders " , "founders " ], known_founder_kinship
756
+ ds_known ["founder_kinship" ] = ["founders_1 " , "founders_2 " ], known_founder_kinship
757
757
with pytest .warns (DeprecationWarning ):
758
758
actual = sg .pedigree_kinship (
759
759
ds_known ,
@@ -867,7 +867,7 @@ def test_pedigree_kinship__raise_on_founder_variable_shape():
867
867
["S1" , "S2" ],
868
868
["S2" , "S3" ],
869
869
]
870
- ds ["founder_kinship" ] = ["founders " , "founders " ], [[0.5 , 0.1 ], [0.1 , 0.5 ]]
870
+ ds ["founder_kinship" ] = ["founders_1 " , "founders_2 " ], [[0.5 , 0.1 ], [0.1 , 0.5 ]]
871
871
ds ["founder_indices" ] = ["founders2" ], [0 , 1 , 2 ]
872
872
with pytest .raises (
873
873
ValueError ,
@@ -887,7 +887,9 @@ def test_pedigree_kinship__raise_too_many_founders():
887
887
["S1" , "S2" ],
888
888
["S2" , "S3" ],
889
889
]
890
- ds ["founder_kinship" ] = ["founders" , "founders" ], np .random .rand (36 ).reshape (6 , 6 )
890
+ ds ["founder_kinship" ] = ["founders_1" , "founders_2" ], np .random .rand (36 ).reshape (
891
+ 6 , 6
892
+ )
891
893
ds ["founder_indices" ] = ["founders" ], np .arange (6 )
892
894
with pytest .raises (
893
895
ValueError , match = "The number of founders exceeds the total number of samples"
@@ -1035,7 +1037,7 @@ def test_pedigree_inbreeding__Hamilton_Kerr_compress_parent_dimension(
1035
1037
ds2 ["parent" ] = dims , parent
1036
1038
ds2 ["stat_Hamilton_Kerr_tau" ] = dims , tau
1037
1039
ds2 ["stat_Hamilton_Kerr_lambda" ] = dims , lambda_
1038
- assert (ds1 .dims ["parents" ], ds2 .dims ["parents" ]) == (2 , n_parent )
1040
+ assert (ds1 .sizes ["parents" ], ds2 .sizes ["parents" ]) == (2 , n_parent )
1039
1041
expect = pedigree_inbreeding (
1040
1042
ds1 , method = "Hamilton-Kerr" , allow_half_founders = n_half_founder > 0
1041
1043
).stat_pedigree_inbreeding
@@ -1249,7 +1251,7 @@ def test_pedigree_inverse_kinship__Hamilton_Kerr_compress_parent_dimension(
1249
1251
ds2 ["parent" ] = dims , parent
1250
1252
ds2 ["stat_Hamilton_Kerr_tau" ] = dims , tau
1251
1253
ds2 ["stat_Hamilton_Kerr_lambda" ] = dims , lambda_
1252
- assert (ds1 .dims ["parents" ], ds2 .dims ["parents" ]) == (2 , n_parent )
1254
+ assert (ds1 .sizes ["parents" ], ds2 .sizes ["parents" ]) == (2 , n_parent )
1253
1255
expect = pedigree_inverse_kinship (
1254
1256
ds1 , method = "Hamilton-Kerr" , allow_half_founders = n_half_founder > 0
1255
1257
).stat_pedigree_inverse_kinship
0 commit comments