Skip to content

Commit 496cfed

Browse files
Replace dask.utils.parse_bytes with humanfriendly
1 parent fea2d9d commit 496cfed

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

bio2zarr/vcf_partition.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
from typing import Any, Dict, Optional, Sequence, Union
22

3-
import dask
43
import fsspec
54
import numpy as np
65
from cyvcf2 import VCF
6+
import humanfriendly
77

88
from bio2zarr.csi import CSI_EXTENSION, read_csi
99
from bio2zarr.tbi import TABIX_EXTENSION, read_tabix
@@ -128,7 +128,10 @@ def partition_into_regions(
128128
raise ValueError("num_parts must be positive")
129129

130130
if target_part_size is not None:
131-
target_part_size_bytes: int = dask.utils.parse_bytes(target_part_size)
131+
if isinstance(target_part_size, int):
132+
target_part_size_bytes = target_part_size
133+
else:
134+
target_part_size_bytes = humanfriendly.parse_size(target_part_size)
132135
if target_part_size_bytes < 1:
133136
raise ValueError("target_part_size must be positive")
134137

0 commit comments

Comments
 (0)