@@ -391,31 +391,34 @@ def workflow_add_task(project_name, workflow_name, tasks):
391
391
@click .argument ("workflow_name" , required = True , nargs = 1 )
392
392
@click .argument ("input_dataset" , required = True , nargs = 1 )
393
393
@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 )
395
395
@click .argument ("resource_out" , required = True , nargs = 1 )
396
396
@click .argument ("json_worker_params" , required = True , nargs = 1 )
397
397
def workflow_apply (
398
398
project_name ,
399
399
workflow_name ,
400
400
input_dataset ,
401
401
output_dataset ,
402
- resource_in ,
402
+ resources_in ,
403
403
resource_out ,
404
404
json_worker_params ,
405
405
):
406
406
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
+ ]
408
410
resource_out = add_slash_to_path (resource_out )
409
411
410
412
prj , _ = project_file_load (project_name )
411
413
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
413
415
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
+ )
419
422
420
423
# If the resource_out folder is not there, create it
421
424
path_resource_out = Path (resource_out )
@@ -481,8 +484,7 @@ def collect_intermediate_results(inputs=[]):
481
484
"create_zarr_structure_multifov" ,
482
485
]:
483
486
kwargs = dict (
484
- # FIXME : add support for a list!
485
- in_paths = [resource_in ],
487
+ in_paths = resources_in ,
486
488
out_path = resource_out ,
487
489
ext = ext ,
488
490
num_levels = num_levels ,
@@ -496,14 +498,15 @@ def app_create_zarr_structure(**kwargs_):
496
498
return dict_tasks [task_names [0 ]](** kwargs )
497
499
498
500
future = app_create_zarr_structure (** kwargs )
501
+
499
502
if task_names [0 ] == "create_zarr_structure" :
500
- zarrurls , channels = future .result ()
503
+ zarrurls , chl_list = future .result ()
501
504
debug (zarrurls )
502
- debug (channels )
505
+ debug (chl_list )
503
506
elif task_names [0 ] == "create_zarr_structure_multifov" :
504
- zarrurls , channels , sites_list = future .result ()
507
+ zarrurls , chl_list , sites_list = future .result ()
505
508
debug (zarrurls )
506
- debug (channels )
509
+ debug (chl_list )
507
510
debug (sites_list )
508
511
task_names = task_names [1 :] # FIXME
509
512
else :
@@ -514,25 +517,32 @@ def app_create_zarr_structure(**kwargs_):
514
517
# Tasks 1,2,...
515
518
db = db_load ()
516
519
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
+ )
517
527
518
528
if task == "yokogawa_to_zarr" :
519
529
kwargs = dict (
520
- in_path = resource_in ,
530
+ in_path = resources_in [ 0 ], # FIXME
521
531
ext = ext ,
522
532
delete_input = delete_input ,
523
533
rows = rows ,
524
534
cols = cols ,
525
- channels = channels ,
535
+ chl_list = chl_list ,
526
536
num_levels = num_levels ,
527
537
coarsening_xy = coarsening_xy ,
528
538
coarsening_z = coarsening_z ,
529
539
)
530
540
if task == "yokogawa_to_zarr_multifov" :
531
541
kwargs = dict (
532
- in_path = resource_in ,
542
+ in_path = resources_in [ 0 ], # FIXME
533
543
ext = ext ,
534
544
delete_input = delete_input ,
535
- channels = channels ,
545
+ chl_list = chl_list ,
536
546
sites_list = sites_list ,
537
547
num_levels = num_levels ,
538
548
coarsening_xy = coarsening_xy ,
@@ -541,7 +551,6 @@ def app_create_zarr_structure(**kwargs_):
541
551
542
552
elif task == "maximum_intensity_projection" :
543
553
kwargs = dict (
544
- channels = channels ,
545
554
coarsening_xy = coarsening_xy ,
546
555
)
547
556
elif task == "replicate_zarr_structure_mip" :
@@ -550,7 +559,7 @@ def app_create_zarr_structure(**kwargs_):
550
559
kwargs = dict (newzarrurl = "new" )
551
560
elif task == "illumination_correction" :
552
561
kwargs = dict (
553
- channels = channels ,
562
+ chl_list = chl_list ,
554
563
coarsening_xy = coarsening_xy ,
555
564
overwrite = True ,
556
565
# background=background,
0 commit comments