Skip to content

Commit d8c6d57

Browse files
committed
Use str dtype
1 parent 8d9ec10 commit d8c6d57

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

bio2zarr/vcf2zarr/icf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ def smallest_dtype(self):
9999
ret = "U1"
100100
else:
101101
assert self.vcf_type == "String"
102-
ret = "O"
102+
ret = "str"
103103
return ret
104104

105105

bio2zarr/vcf2zarr/vcz.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -288,14 +288,14 @@ def fixed_field_spec(
288288
),
289289
fixed_field_spec(
290290
name="variant_allele",
291-
dtype="O",
291+
dtype="str",
292292
shape=(m, max_alleles),
293293
dimensions=["variants", "alleles"],
294294
chunks=(variants_chunk_size, max_alleles),
295295
),
296296
fixed_field_spec(
297297
name="variant_id",
298-
dtype="O",
298+
dtype="str",
299299
),
300300
fixed_field_spec(
301301
name="variant_id_mask",
@@ -399,9 +399,11 @@ def summary_table(self):
399399
"avg_chunk_stored": core.display_size(int(stored / array.nchunks)),
400400
"shape": str(array.shape),
401401
"chunk_shape": str(array.chunks),
402-
"compressor": str(array.compressor),
403-
"filters": str(array.filters),
404402
}
403+
if hasattr(array, "compressor"):
404+
d["compressor"] = array.compressor
405+
if hasattr(array, "filters"):
406+
d["filters"] = array.filters
405407
data.append(d)
406408
return data
407409

0 commit comments

Comments
 (0)