11import pathlib
22import time
3- from typing import List , Literal
3+ from typing import Literal
44
55import click
66import dcnum .logic
@@ -19,11 +19,11 @@ def process_dataset(
1919 path_in : pathlib .Path ,
2020 path_out : pathlib .Path ,
2121 background_method : str ,
22- background_kwargs : List [str ],
22+ background_kwargs : list [str ],
2323 segmentation_method : str ,
24- segmentation_kwargs : List [str ],
25- feature_kwargs : List [str ],
26- gate_kwargs : List [str ],
24+ segmentation_kwargs : list [str ],
25+ feature_kwargs : list [str ],
26+ gate_kwargs : list [str ],
2727 pixel_size : float ,
2828 index_mapping : int | slice | None ,
2929 # Below this line are arguments that do not affect the pipeline ID
@@ -63,37 +63,37 @@ def process_dataset(
6363 click .echo (f"Data ID:\t { dat_id } " )
6464
6565 # background keyword arguments
66- bg_kwargs = validate_background_kwargs (background_method ,
67- background_kwargs )
66+ bg_kwargs_dict = validate_background_kwargs (background_method ,
67+ background_kwargs )
6868 if (background_method == "sparsemed"
69- and "offset_correction" not in bg_kwargs ):
69+ and "offset_correction" not in bg_kwargs_dict ):
7070 # We are using the 'sparsemed' background algorithm, and the user
7171 # did not specify whether they want to perform flickering
7272 # correction. Thus, we automatically check whether we need that.
7373 with dcnum .read .HDF5Data (path_in ) as hd :
74- bg_kwargs ["offset_correction" ] = \
74+ bg_kwargs_dict ["offset_correction" ] = \
7575 dcnum .read .detect_flickering (hd .image )
7676 bg_cls = cm .get_available_background_methods ()[background_method ]
77- bg_id = bg_cls .get_ppid_from_ppkw (bg_kwargs )
77+ bg_id = bg_cls .get_ppid_from_ppkw (bg_kwargs_dict )
7878 click .echo (f"Background ID:\t { bg_id } " )
7979
8080 # segmenter keyword arguments
81- seg_kwargs = validate_segmentation_kwargs (segmentation_method ,
82- segmentation_kwargs )
81+ seg_kwargs_dict = validate_segmentation_kwargs (segmentation_method ,
82+ segmentation_kwargs )
8383 seg_cls = cm .get_segmenters ()[segmentation_method ]
84- seg_id = seg_cls .get_ppid_from_ppkw (seg_kwargs )
84+ seg_id = seg_cls .get_ppid_from_ppkw (seg_kwargs_dict )
8585 click .echo (f"Segmenter ID:\t { seg_id } " )
8686
8787 # feature keyword arguments
88- feat_kwargs = validate_feature_kwargs (feature_kwargs )
88+ feat_kwargs_dict = validate_feature_kwargs (feature_kwargs )
8989 feat_cls = cm .QueueEventExtractor
90- feat_id = feat_cls .get_ppid_from_ppkw (feat_kwargs )
90+ feat_id = feat_cls .get_ppid_from_ppkw (feat_kwargs_dict )
9191 click .echo (f"Feature ID:\t { feat_id } " )
9292
9393 # gate keyword arguments
9494 gate_cls = cm .Gate
95- gate_kwargs = validate_gate_kwargs (gate_kwargs )
96- gate_id = gate_cls .get_ppid_from_ppkw (gate_kwargs )
95+ gate_kwargs_dict = validate_gate_kwargs (gate_kwargs )
96+ gate_id = gate_cls .get_ppid_from_ppkw (gate_kwargs_dict )
9797 click .echo (f"Gate ID:\t { gate_id } " )
9898
9999 # compute pipeline hash
@@ -116,13 +116,13 @@ def process_dataset(
116116 data_code = "hdf" ,
117117 data_kwargs = data_kwargs ,
118118 background_code = bg_cls .get_ppid_code (),
119- background_kwargs = bg_kwargs ,
119+ background_kwargs = bg_kwargs_dict ,
120120 segmenter_code = seg_cls .get_ppid_code (),
121- segmenter_kwargs = seg_kwargs ,
121+ segmenter_kwargs = seg_kwargs_dict ,
122122 feature_code = feat_cls .get_ppid_code (),
123- feature_kwargs = feat_kwargs ,
123+ feature_kwargs = feat_kwargs_dict ,
124124 gate_code = gate_cls .get_ppid_code (),
125- gate_kwargs = gate_kwargs ,
125+ gate_kwargs = gate_kwargs_dict ,
126126 basin_strategy = basin_strategy ,
127127 compression = compression ,
128128 num_procs = num_cpus ,
@@ -152,7 +152,7 @@ def process_dataset(
152152 if status ["state" ] in ["done" , "error" ]:
153153 break
154154 time .sleep (.3 ) # don't use 100% CPU
155- print ("" ) # new line
155+ print () # new line
156156
157157 if status ["state" ] == "error" :
158158 runner .join (delete_temporary_files = False )
0 commit comments