Skip to content

Commit 6cdbe8d

Browse files
Bump up tests a bit
1 parent 1420b07 commit 6cdbe8d

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

bio2zarr/vcf.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,13 +539,18 @@ def get_path(base_path, vcf_field):
539539
return base_path / vcf_field.name
540540
return base_path / vcf_field.category / vcf_field.name
541541

542+
@property
543+
def name(self):
544+
return self.vcf_field.full_name
545+
542546
def partition_path(self, partition_id):
543547
return self.path / f"p{partition_id}"
544548

545549
def __repr__(self):
546550
partition_chunks = [self.num_chunks(j) for j in range(self.num_partitions)]
547551
return (
548-
f"PickleChunkedVcfField(partition_chunks={partition_chunks}, "
552+
f"PickleChunkedVcfField(name={self.name}, "
553+
f"partition_chunks={partition_chunks}, "
549554
f"path={self.path})"
550555
)
551556

tests/test_pcvcf.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,11 @@ def test_repr(self, pcvcf):
163163
"PickleChunkedVcf(fields=7, partitions=5, records=4665, path="
164164
)
165165

166+
def test_pos_repr(self, pcvcf):
167+
assert repr(pcvcf["POS"]).startswith(
168+
"PickleChunkedVcfField(name=POS, partition_chunks=[8, 8, 8, 8, 8], path=")
169+
170+
166171
def test_partition_record_index(self, pcvcf):
167172
nt.assert_array_equal(
168173
pcvcf.partition_record_index, [0, 933, 1866, 2799, 3732, 4665]

0 commit comments

Comments
 (0)