@@ -205,12 +205,6 @@ def test_generated_no_fields(self, icf_path):
205205 schema .fields .clear ()
206206 self .assert_json_round_trip (schema )
207207
208- def test_generated_no_samples (self , icf_path ):
209- icf = icf_mod .IntermediateColumnarFormat (icf_path )
210- schema = icf .generate_schema ()
211- schema .samples .clear ()
212- self .assert_json_round_trip (schema )
213-
214208 def test_generated_change_dtype (self , icf_path ):
215209 icf = icf_mod .IntermediateColumnarFormat (icf_path )
216210 schema = icf .generate_schema ()
@@ -337,23 +331,6 @@ def test_chunk_size(self, schema):
337331 assert schema .samples_chunk_size == 10000
338332 assert schema .variants_chunk_size == 1000
339333
340- def test_samples (self , schema ):
341- assert schema .asdict ()["samples" ] == [
342- {"id" : s } for s in ["NA00001" , "NA00002" , "NA00003" ]
343- ]
344-
345- def test_contigs (self , schema ):
346- assert schema .asdict ()["contigs" ] == [
347- {"id" : s , "length" : None } for s in ["19" , "20" , "X" ]
348- ]
349-
350- def test_filters (self , schema ):
351- assert schema .asdict ()["filters" ] == [
352- {"id" : "PASS" , "description" : "All filters passed" },
353- {"id" : "s50" , "description" : "Less than 50% of samples have data" },
354- {"id" : "q10" , "description" : "Quality below 10" },
355- ]
356-
357334 def test_variant_contig (self , schema ):
358335 assert get_field_dict (schema , "variant_contig" ) == {
359336 "name" : "variant_contig" ,
@@ -505,18 +482,6 @@ class TestVcfDescriptions:
505482 def test_fields (self , schema , field , description ):
506483 assert schema .field_map ()[field ].description == description
507484
508- @pytest .mark .parametrize (
509- ("filt" , "description" ),
510- [
511- ("PASS" , "All filters passed" ),
512- ("s50" , "Less than 50% of samples have data" ),
513- ("q10" , "Quality below 10" ),
514- ],
515- )
516- def test_filters (self , schema , filt , description ):
517- d = {f .id : f .description for f in schema .filters }
518- assert d [filt ] == description
519-
520485
521486class TestVcfZarrWriterExample :
522487 arrays = (
@@ -689,33 +654,6 @@ def test_call_fields(self, tmp_path, field):
689654 icf_mod .explode (tmp_path / "x.icf" , [tmp_path / "test.vcf.gz" ])
690655
691656
692- class TestBadSchemaChanges :
693- # [{'id': 'NA00001'}, {'id': 'NA00002'}, {'id': 'NA00003'}],
694- @pytest .mark .parametrize (
695- "samples" ,
696- [
697- [],
698- [{"id" : "NA00001" }, {"id" : "NA00003" }],
699- [{"id" : "NA00001" }, {"id" : "NA00002" }, {"id" : "NA00004" }],
700- [
701- {"id" : "NA00001" },
702- {"id" : "NA00002" },
703- {"id" : "NA00003" },
704- {"id" : "NA00004" },
705- ],
706- [{"id" : "NA00001" }, {"id" : "NA00003" }, {"id" : "NA00002" }],
707- ],
708- )
709- def test_removed_samples (self , tmp_path , schema , icf_path , samples ):
710- d = schema .asdict ()
711- d ["samples" ] = samples
712- schema_path = tmp_path / "schema.json"
713- with open (schema_path , "w" ) as f :
714- json .dump (d , f )
715- with pytest .raises (ValueError , match = "Subsetting or reordering samples" ):
716- icf_mod .encode (icf_path , tmp_path / "z" , schema_path = schema_path )
717-
718-
719657class TestInspect :
720658 def test_icf (self , icf_path ):
721659 df = pd .DataFrame (icf_mod .inspect (icf_path ))
0 commit comments