@@ -55,7 +55,7 @@ def init_dataset(src :str,
5555def to_zarr (src : str ,
5656 dest : str ,
5757 client : Client ,
58- num_workers : int = 20 ,
58+ workers : int = 20 ,
5959 zarr_chunks : list [int ] = [128 ]* 3 ,
6060 axes : list [str ] = ['z' , 'y' , 'x' ],
6161 scale : list [float ] = [1.0 ,]* 3 ,
@@ -67,7 +67,7 @@ def to_zarr(src : str,
6767 src (str): input data location.
6868 dest (str): output zarr group location.
6969 client (Client): dask client instance.
70- num_workers (int, optional): Number of dask workers. Defaults to 20.
70+ workers (int, optional): Number of dask workers. Defaults to 20.
7171 zarr_chunks (list[int], optional): _description_. Defaults to [128,]*3.
7272 axes (list[str], optional): axis order. Defaults to ['z', 'y', 'x'].
7373 scale (list[float], optional): voxel size (in physical units). Defaults to [1.0,]*3.
@@ -78,7 +78,7 @@ def to_zarr(src : str,
7878 dataset = init_dataset (src , axes , scale , translation , units )
7979
8080 # write in parallel to zarr using dask
81- client .cluster .scale (num_workers )
81+ client .cluster .scale (workers )
8282 dataset .write_to_zarr (dest , client , zarr_chunks )
8383 client .cluster .scale (0 )
8484 # populate zarr metadata
@@ -94,7 +94,7 @@ def to_zarr(src : str,
9494)
9595@click .option ("--dest" , "-d" , type = click .STRING , help = "Output .zarr file path." )
9696@click .option (
97- "--num_workers " , "-w" , default = 100 , type = click .INT , help = "Number of dask workers"
97+ "--workers " , "-w" , default = 100 , type = click .INT , help = "Number of dask workers"
9898)
9999@click .option (
100100 "--cluster" ,
@@ -143,7 +143,7 @@ def to_zarr(src : str,
143143 type = str ,
144144 help = "Metadata unit names. Order matters. \n Example: -t nanometer nanometer nanometer" ,
145145)
146- def cli (src , dest , num_workers , cluster , zarr_chunks , axes , translation , scale , units ):
146+ def cli (src , dest , workers , cluster , zarr_chunks , axes , translation , scale , units ):
147147
148148 # create a dask client to submit tasks
149149 client = initialize_dask_client (cluster )
@@ -152,7 +152,7 @@ def cli(src, dest, num_workers, cluster, zarr_chunks, axes, translation, scale,
152152 to_zarr (src ,
153153 dest ,
154154 client ,
155- num_workers ,
155+ workers ,
156156 zarr_chunks ,
157157 axes ,
158158 scale ,
0 commit comments