Skip to content

Commit

Permalink
remove dask sync (was debugging), and set chunks
Browse files Browse the repository at this point in the history
  • Loading branch information
akhanf committed Oct 4, 2024
1 parent 8739291 commit 3b03fbd
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions workflow/scripts/tif_to_zarr_gcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
'token': snakemake.input.creds}
fs = gcsfs.GCSFileSystem(**gcsfs_opts)

dask.config.set(scheduler='synchronous') # overwrite default with single-threaded scheduler

def replace_square_brackets(pattern):
"""replace all [ and ] in the string (have to use
Expand Down Expand Up @@ -136,7 +135,7 @@ def build_zstack_from_single(gcs_uri,zstack_metadata,fs):

tif_file = in_tif_pattern.format(tilex=tilex,tiley=tiley,prefix=metadata['prefixes'][0],channel=channel)

zstacks.append(da.from_delayed(delayed(read_stack_as_numpy)('gcs://'+tif_file,fs,size_z,size_y,size_x),shape=(size_z,size_y,size_x),dtype='uint16'))
zstacks.append(da.from_delayed(delayed(read_stack_as_numpy)('gcs://'+tif_file,fs,size_z,size_y,size_x),shape=(size_z,size_y,size_x),chunks=(1,size_y,size_x),dtype='uint16'))

else:
zstacks.append(build_zstack(fs.glob('gcs://'+in_tif_glob.format(tilex=tilex,tiley=tiley,prefix=metadata['prefixes'][0],channel=channel,zslice='*')),fs=fs))
Expand Down

0 comments on commit 3b03fbd

Please sign in to comment.