Skip to content

Commit e50a482

Browse files
authored
Merge pull request #73 from fractal-analytics-platform/dev-channels
Deterministic channel assignment across wells/plates [ref #61]
2 parents 0426634 + b3fd38e commit e50a482

12 files changed

+360
-165
lines changed

fractal/fractal_cmd.py

Lines changed: 25 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -391,31 +391,34 @@ def workflow_add_task(project_name, workflow_name, tasks):
391391
@click.argument("workflow_name", required=True, nargs=1)
392392
@click.argument("input_dataset", required=True, nargs=1)
393393
@click.argument("output_dataset", required=True, nargs=1)
394-
@click.argument("resource_in", required=True, nargs=1)
394+
@click.argument("resources_in", required=True, nargs=-1)
395395
@click.argument("resource_out", required=True, nargs=1)
396396
@click.argument("json_worker_params", required=True, nargs=1)
397397
def workflow_apply(
398398
project_name,
399399
workflow_name,
400400
input_dataset,
401401
output_dataset,
402-
resource_in,
402+
resources_in,
403403
resource_out,
404404
json_worker_params,
405405
):
406406

407-
resource_in = add_slash_to_path(resource_in)
407+
resources_in = [
408+
add_slash_to_path(resource_in) for resource_in in resources_in
409+
]
408410
resource_out = add_slash_to_path(resource_out)
409411

410412
prj, _ = project_file_load(project_name)
411413

412-
# Verify that resource_in has been added to the resources of input_dataset
414+
# Verify that resources_in has been added to the resources of input_dataset
413415
dataset_resources = prj["datasets"][input_dataset]["resources"]
414-
if resource_in not in dataset_resources:
415-
raise Exception(
416-
f"Error in workflow_apply, {resource_in} not in"
417-
f" {dataset_resources}"
418-
)
416+
for resource_in in resources_in:
417+
if resource_in not in dataset_resources:
418+
raise Exception(
419+
f"Error in workflow_apply, {resource_in} not in"
420+
f" {dataset_resources}"
421+
)
419422

420423
# If the resource_out folder is not there, create it
421424
path_resource_out = Path(resource_out)
@@ -481,7 +484,7 @@ def collect_intermediate_results(inputs=[]):
481484
"create_zarr_structure_multifov",
482485
]:
483486
kwargs = dict(
484-
in_path=resource_in,
487+
in_paths=resources_in,
485488
out_path=resource_out,
486489
ext=ext,
487490
num_levels=num_levels,
@@ -495,8 +498,11 @@ def app_create_zarr_structure(**kwargs_):
495498
return dict_tasks[task_names[0]](**kwargs)
496499

497500
future = app_create_zarr_structure(**kwargs)
501+
498502
if task_names[0] == "create_zarr_structure":
499503
zarrurls, chl_list = future.result()
504+
debug(zarrurls)
505+
debug(chl_list)
500506
elif task_names[0] == "create_zarr_structure_multifov":
501507
zarrurls, chl_list, sites_list = future.result()
502508
debug(zarrurls)
@@ -511,10 +517,17 @@ def app_create_zarr_structure(**kwargs_):
511517
# Tasks 1,2,...
512518
db = db_load()
513519
for task in task_names:
520+
if len(resources_in) > 1:
521+
raise Exception(
522+
"ERROR\n"
523+
"Support for len(resources_in)>1 is not there.\n"
524+
"Hint: we should modify the in_path argument of"
525+
"yokogawa_to_zarr."
526+
)
514527

515528
if task == "yokogawa_to_zarr":
516529
kwargs = dict(
517-
in_path=resource_in,
530+
in_path=resources_in[0], # FIXME
518531
ext=ext,
519532
delete_input=delete_input,
520533
rows=rows,
@@ -526,7 +539,7 @@ def app_create_zarr_structure(**kwargs_):
526539
)
527540
if task == "yokogawa_to_zarr_multifov":
528541
kwargs = dict(
529-
in_path=resource_in,
542+
in_path=resources_in[0], # FIXME
530543
ext=ext,
531544
delete_input=delete_input,
532545
chl_list=chl_list,
@@ -538,7 +551,6 @@ def app_create_zarr_structure(**kwargs_):
538551

539552
elif task == "maximum_intensity_projection":
540553
kwargs = dict(
541-
chl_list=chl_list,
542554
coarsening_xy=coarsening_xy,
543555
)
544556
elif task == "replicate_zarr_structure_mip":

0 commit comments

Comments
 (0)