@@ -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,7 +484,7 @@ def collect_intermediate_results(inputs=[]):
481
484
"create_zarr_structure_multifov" ,
482
485
]:
483
486
kwargs = dict (
484
- in_path = resource_in ,
487
+ in_paths = resources_in ,
485
488
out_path = resource_out ,
486
489
ext = ext ,
487
490
num_levels = num_levels ,
@@ -495,8 +498,11 @@ def app_create_zarr_structure(**kwargs_):
495
498
return dict_tasks [task_names [0 ]](** kwargs )
496
499
497
500
future = app_create_zarr_structure (** kwargs )
501
+
498
502
if task_names [0 ] == "create_zarr_structure" :
499
503
zarrurls , chl_list = future .result ()
504
+ debug (zarrurls )
505
+ debug (chl_list )
500
506
elif task_names [0 ] == "create_zarr_structure_multifov" :
501
507
zarrurls , chl_list , sites_list = future .result ()
502
508
debug (zarrurls )
@@ -511,10 +517,17 @@ def app_create_zarr_structure(**kwargs_):
511
517
# Tasks 1,2,...
512
518
db = db_load ()
513
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
+ )
514
527
515
528
if task == "yokogawa_to_zarr" :
516
529
kwargs = dict (
517
- in_path = resource_in ,
530
+ in_path = resources_in [ 0 ], # FIXME
518
531
ext = ext ,
519
532
delete_input = delete_input ,
520
533
rows = rows ,
@@ -526,7 +539,7 @@ def app_create_zarr_structure(**kwargs_):
526
539
)
527
540
if task == "yokogawa_to_zarr_multifov" :
528
541
kwargs = dict (
529
- in_path = resource_in ,
542
+ in_path = resources_in [ 0 ], # FIXME
530
543
ext = ext ,
531
544
delete_input = delete_input ,
532
545
chl_list = chl_list ,
@@ -538,7 +551,6 @@ def app_create_zarr_structure(**kwargs_):
538
551
539
552
elif task == "maximum_intensity_projection" :
540
553
kwargs = dict (
541
- chl_list = chl_list ,
542
554
coarsening_xy = coarsening_xy ,
543
555
)
544
556
elif task == "replicate_zarr_structure_mip" :
0 commit comments