@@ -600,6 +600,22 @@ def test_ploidy1_unphased(self, tmp_path):
600
600
sgkit .save_dataset (ds , path )
601
601
tsinfer .SgkitSampleData (path )
602
602
603
+ def test_duplicate_positions (self , tmp_path ):
604
+ path = tmp_path / "data.zarr"
605
+ ds = sgkit .simulate_genotype_call_dataset (n_variant = 3 , n_sample = 3 , phased = True )
606
+ ds ["variant_position" ][2 ] = ds ["variant_position" ][1 ]
607
+ sgkit .save_dataset (ds , path )
608
+ with pytest .raises (ValueError , match = "duplicate or out-of-order values" ):
609
+ tsinfer .SgkitSampleData (path )
610
+
611
+ def test_bad_order_positions (self , tmp_path ):
612
+ path = tmp_path / "data.zarr"
613
+ ds = sgkit .simulate_genotype_call_dataset (n_variant = 3 , n_sample = 3 , phased = True )
614
+ ds ["variant_position" ][0 ] = ds ["variant_position" ][2 ] - 0.5
615
+ sgkit .save_dataset (ds , path )
616
+ with pytest .raises (ValueError , match = "duplicate or out-of-order values" ):
617
+ tsinfer .SgkitSampleData (path )
618
+
603
619
def test_empty_alleles_not_at_end (self , tmp_path ):
604
620
path = tmp_path / "data.zarr"
605
621
ds = sgkit .simulate_genotype_call_dataset (n_variant = 3 , n_sample = 3 , n_ploidy = 1 )
0 commit comments