From 1f10af79bc90a001ea19170ce6e535d5385068fe Mon Sep 17 00:00:00 2001 From: Harry Carey Date: Sun, 8 Dec 2024 02:23:18 +1100 Subject: [PATCH] remove parallelism --- .../atlas_scripts/australian_mouse_brain.py | 61 ++++++------------- 1 file changed, 18 insertions(+), 43 deletions(-) diff --git a/brainglobe_atlasapi/atlas_generation/atlas_scripts/australian_mouse_brain.py b/brainglobe_atlasapi/atlas_generation/atlas_scripts/australian_mouse_brain.py index 3dd5ff8..d763062 100644 --- a/brainglobe_atlasapi/atlas_generation/atlas_scripts/australian_mouse_brain.py +++ b/brainglobe_atlasapi/atlas_generation/atlas_scripts/australian_mouse_brain.py @@ -48,7 +48,6 @@ "hippocampus": 1004, "diencephalon": 1005, } -PARALLEL = False acronym_dict = { "diencephalon": { "mfb": "Medial forebrain bundle", @@ -794,49 +793,25 @@ def retrieve_or_construct_meshes(annotated_volume, structures): smooth = False start = time.time() - if PARALLEL: - pool = mp.Pool(mp.cpu_count() - 2) - - try: - pool.map( - create_region_mesh, - [ - ( - meshes_dir_path, - node, - tree, - labels, - annotated_volume, - ROOT_ID, - closing_n_iters, - decimate_fraction, - smooth, - ) - for node in tree.nodes.values() - ], - ) - except mp.pool.MaybeEncodingError: - # error with returning results from pool.map but we don't care - pass - else: - for node in track( - tree.nodes.values(), - total=tree.size(), - description="Creating meshes", - ): - create_region_mesh( - ( - meshes_dir_path, - node, - tree, - labels, - annotated_volume, - ROOT_ID, - closing_n_iters, - decimate_fraction, - smooth, - ) + + for node in track( + tree.nodes.values(), + total=tree.size(), + description="Creating meshes", + ): + create_region_mesh( + ( + meshes_dir_path, + node, + tree, + labels, + annotated_volume, + ROOT_ID, + closing_n_iters, + decimate_fraction, + smooth, ) + ) print( "Finished mesh extraction in: ",