Skip to content

Commit

Permalink
Fix tests for new numcodecs
Browse files Browse the repository at this point in the history
  • Loading branch information
benjeffery committed Jul 17, 2024
1 parent 0768962 commit 8df62c5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tests/test_icf.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,8 +402,8 @@ def test_empty_chunk_file(self, tmp_path):
with pytest.raises(RuntimeError, match="blosc"):
icf["POS"].values # noqa B018

# Chunk file is 195 long for numpy v1, and 193 long for v2
@pytest.mark.parametrize("length", [10, 100, 190, 192])
# Chunk file is 187 long
@pytest.mark.parametrize("length", [10, 100, 185])
def test_truncated_chunk_file(self, tmp_path, length):
icf_path = tmp_path / "icf"
vcf2zarr.explode(icf_path, [self.data_path])
Expand Down
7 changes: 5 additions & 2 deletions tests/test_vcf_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -959,9 +959,12 @@ def test_split_explode(tmp_path):
vcf2zarr.explode_partition(out, j)
vcf2zarr.explode_finalise(out)
pcvcf = vcf2zarr.IntermediateColumnarFormat(out)
assert pcvcf.fields["POS"].vcf_field.summary.asdict() == {
summary_d = pcvcf.fields["POS"].vcf_field.summary.asdict()
# The compressed size can vary with different numcodecs versions
assert summary_d["compressed_size"] == 571 or summary_d["compressed_size"] == 587
del summary_d["compressed_size"]
assert summary_d == {
"num_chunks": 3,
"compressed_size": 587,
"uncompressed_size": 1008,
"max_number": 1,
"max_value": 1235237,
Expand Down

0 comments on commit 8df62c5

Please sign in to comment.