Skip to content

Commit

Permalink
removed multiprocess for github ci to finish
Browse files Browse the repository at this point in the history
  • Loading branch information
GwydionJon committed Jun 27, 2024
1 parent 245fb56 commit 7e61f01
Showing 1 changed file with 19 additions and 15 deletions.
34 changes: 19 additions & 15 deletions organelle_morphology/util.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import contextlib
import cachetools
import hashlib
import multiprocess

# import multiprocess
import shelved_cache
import xdg
from tqdm import tqdm
Expand Down Expand Up @@ -36,21 +37,24 @@ def disk_cache(project, name, maxsize=10000):
cache.close()


@contextlib.contextmanager
def parallel_pool(total=None, cores=None):
"""A context manager that runs the code in parallel"""
# Create a process pool
# not sure yet wether to fully remove it or try to integrate it again.


# @contextlib.contextmanager
# def parallel_pool(total=None, cores=None):
# """A context manager that runs the code in parallel"""
# # Create a process pool

pool = multiprocess.Pool(cores)
# pool = multiprocess.Pool(cores)

# Run the code in parallel
if total:
pbar = tqdm(total=total)
yield pool, pbar
# # Run the code in parallel
# if total:
# pbar = tqdm(total=total)
# yield pool, pbar

else:
yield pool
# else:
# yield pool

# Close the pool
pool.close()
pool.join()
# # Close the pool
# pool.close()
# pool.join()

0 comments on commit 7e61f01

Please sign in to comment.