Skip to content

Commit 945112d

Browse files
committed
pre-commit passing
1 parent c691ecf commit 945112d

File tree

2 files changed

+13
-16
lines changed

2 files changed

+13
-16
lines changed

bio2zarr/vcf2zarr/icf.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,11 @@ def __eq__(self, other):
196196
if not isinstance(other, IcfMetadata):
197197
return NotImplemented
198198
return (
199-
self.samples == other.samples and
200-
self.contigs == other.contigs and
201-
self.filters == other.filters and
202-
sorted(self.fields) == sorted(other.fields)
203-
)
199+
self.samples == other.samples
200+
and self.contigs == other.contigs
201+
and self.filters == other.filters
202+
and sorted(self.fields) == sorted(other.fields)
203+
)
204204

205205

206206
def fixed_vcf_field_definitions():

tests/test_vcf_examples.py

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,14 +1101,16 @@ def test_missing_filter(tmp_path):
11011101
with pytest.raises(ValueError, match="Filter 'q10' was not defined in the header"):
11021102
vcf2zarr.convert([path], zarr_path)
11031103

1104+
11041105
class TestOutOfOrderFields:
1105-
data_paths = ["tests/data/vcf/out_of_order_fields/input1.bcf",
1106-
"tests/data/vcf/out_of_order_fields/input2.bcf"]
1106+
# Mixing on purpose
1107+
data_path1 = "tests/data/vcf/out_of_order_fields/input2.bcf"
1108+
data_path2 = "tests/data/vcf/out_of_order_fields/input1.bcf"
11071109

11081110
@pytest.fixture(scope="class")
11091111
def ds(self, tmp_path_factory):
11101112
out = tmp_path_factory.mktemp("data") / "ooo_example.vcf.zarr"
1111-
vcf2zarr.convert(self.data_paths, out)
1113+
vcf2zarr.convert([self.data_path1, self.data_path2], out)
11121114
return sg.load_dataset(out)
11131115

11141116
def test_filters(self, ds):
@@ -1127,7 +1129,7 @@ def test_source(self, ds):
11271129

11281130
def test_contigs(self, ds):
11291131
nt.assert_array_equal(ds["contig_id"], ["chr20", "chr21"])
1130-
nt.assert_array_equal(ds['contig_length'], [64444167., 46709983.])
1132+
nt.assert_array_equal(ds["contig_length"], [64444167.0, 46709983.0])
11311133
nt.assert_array_equal(ds["variant_contig"], [0, 1, 1])
11321134

11331135
def test_position(self, ds):
@@ -1139,19 +1141,14 @@ def test_length(self, ds):
11391141
def test_info_fields(self, ds):
11401142
nt.assert_array_equal(
11411143
ds["variant_QNAME"],
1142-
['cluster19_000000F', '.', 'cluster19_000000F'],
1144+
["cluster19_000000F", ".", "cluster19_000000F"],
11431145
)
11441146
nt.assert_array_equal(ds["variant_QSTART"], [25698928, 25698928, -1])
11451147

11461148
def test_allele(self, ds):
1147-
fill = constants.STR_FILL
11481149
nt.assert_array_equal(
11491150
ds["variant_allele"].values.tolist(),
1150-
[
1151-
['TTCCATTCCAC', 'T'],
1152-
['C', 'CTCCAT'],
1153-
['G', 'A']
1154-
]
1151+
[["TTCCATTCCAC", "T"], ["C", "CTCCAT"], ["G", "A"]],
11551152
)
11561153
assert ds["variant_allele"].dtype == "O"
11571154

0 commit comments

Comments
 (0)