Skip to content

Commit

Permalink
Minor fixes, still can't tell if the slurm cluster is actually being …
Browse files Browse the repository at this point in the history
…used...
  • Loading branch information
JonathanCSmith committed Oct 19, 2022
1 parent 2962d18 commit 2a65eae
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
1 change: 1 addition & 0 deletions cluster/slurm.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,5 @@ def build_slurm_cluster(config: dict):
)

cluster.adapt(minimum=0, maximum=jobs)
#cluster.scale(jobs)
return Client(cluster)
11 changes: 7 additions & 4 deletions image/formats.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

import dask.array as da
import zarr
from imagecodecs.numcodecs import Blosc
from numcodecs import Blosc

from skimage.io import imread

Expand All @@ -18,6 +18,8 @@ def validate_or_enforce_zarr(source: str, save_path: str = None, chunk_formats:
:return: the zarr file as a dask array, the actual pixel sizes of the chunks
"""
print(os.listdir("."))

if not os.path.isfile(source):
raise ValueError("The source provided was not a valid path.")

Expand All @@ -32,14 +34,16 @@ def validate_or_enforce_zarr(source: str, save_path: str = None, chunk_formats:

# Optional chunk size
if not chunk_formats:
chunk_formats = (100, 100, 1)
if len(image_size) == 2:
chunk_formats = (100, 100)
else:
chunk_formats = (100, 100, 1)
else:
image_size = image.shape
if len(image_size) == 2:
chunk_formats = (
math.ceil(image_size[0] / chunk_formats[0]),
math.ceil(image_size[1] / chunk_formats[1]),
1
)
else:
chunk_formats = (
Expand All @@ -63,7 +67,6 @@ def validate_or_enforce_zarr(source: str, save_path: str = None, chunk_formats:
chunk_formats = (
math.ceil(image_size[0] / chunk_formats[0]),
math.ceil(image_size[1] / chunk_formats[1]),
1
)
else:
chunk_formats = (
Expand Down
2 changes: 1 addition & 1 deletion workflow/workflows.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ def run_workflow(data_path, data, directives, tile_settings, save_intermediates=

# Final output
# TODO: Better name chaining
output_zarr_to_directory(data, "workflow_output.zarr", data)
output_zarr_to_directory(data_path, "workflow_output.zarr", data)

0 comments on commit 2a65eae

Please sign in to comment.