File tree Expand file tree Collapse file tree 3 files changed +6
-5
lines changed
Expand file tree Collapse file tree 3 files changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -71,7 +71,8 @@ def process_lif_file(
7171 img_xml_dir = img_dir / "metadata"
7272 for folder in (img_dir , img_xml_dir ):
7373 if not folder .exists ():
74- folder .mkdir (parents = True )
74+ # Potential race condition when generating folders from multiple pools
75+ folder .mkdir (parents = True , exist_ok = True )
7576 logger .info (f"Created { folder } " )
7677 else :
7778 logger .info (f"{ folder } already exists" )
Original file line number Diff line number Diff line change @@ -95,11 +95,12 @@ def process_tiff_files(
9595 bit_depth = int (channels [c ].attrib ["Resolution" ])
9696
9797 # Find TIFFs from relevant channel and series
98+ # Replace " " with "_" when comparing file name against series name as found in metadata
9899 tiff_sublist = [
99100 f
100101 for f in tiff_list
101102 if (f"C{ str (c ).zfill (2 )} " in f .stem or f"C{ str (c ).zfill (3 )} " in f .stem )
102- and (img_name == f .stem .split ("--" )[0 ])
103+ and (img_name . replace ( " " , "_" ) == f .stem .split ("--" )[0 ]. replace ( " " , "_" ) )
103104 ]
104105 tiff_sublist .sort (
105106 key = lambda f : (int (f .stem .split ("--" )[1 ].replace ("Z" , "" )),)
Original file line number Diff line number Diff line change @@ -36,9 +36,8 @@ def zocalo_cluster_request(
3636 {
3737 "recipes" : ["lif-to-tiff" ],
3838 "parameters" : {
39- # Represent file paths canonically
40- "session_dir" : repr (str (session_dir )),
41- "lif_path" : repr (str (file )),
39+ "session_dir" : str (session_dir ),
40+ "lif_path" : str (file ),
4241 "root_dir" : root_folder ,
4342 },
4443 },
You can’t perform that action at this time.
0 commit comments