We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 727e47d commit 27a79ecCopy full SHA for 27a79ec
bio2zarr/tskit.py
@@ -153,16 +153,17 @@ def generate_schema(
153
)
154
155
# Check if positions will fit in i4 (max ~2.1 billion)
156
+ min_position = 0
157
max_position = 0
158
if self.ts.num_sites > 0:
159
+ min_position = np.min(self.ts.sites_position)
160
max_position = np.max(self.ts.sites_position)
- position_dtype = "i4" if max_position <= np.iinfo(np.int32).max else "i8"
161
162
array_specs = [
163
vcz.ZarrArraySpec(
164
source="position",
165
name="variant_position",
- dtype=position_dtype,
166
+ dtype=core.min_int_dtype(min_position, max_position),
167
dimensions=["variants"],
168
description="Position of each variant",
169
),
0 commit comments