From 7e03a28b41b081e887a3a339925258cb02b10921 Mon Sep 17 00:00:00 2001 From: Tom Eulenfeld Date: Tue, 25 Jun 2024 14:27:26 +0200 Subject: [PATCH] remove custom Pool code --- anchorna/core.py | 36 ------------------------------------ 1 file changed, 36 deletions(-) diff --git a/anchorna/core.py b/anchorna/core.py index 626c146..e52148f 100644 --- a/anchorna/core.py +++ b/anchorna/core.py @@ -155,42 +155,6 @@ def _start_parallel_jobs(tasks, do_work, results, njobs=0, pbar=None): return results -# def worker(do_work, qinput, qres, **kw): -# while True: -# try: -# task = qinput.get_nowait() -# except: -# return -# result = do_work(task, **kw) -# qres.put(result) -# qres.put('finished') - - -# class MyPool(): -# def __init__(self, njobs): -# self.njobs = njobs -# def imap_unordered(self, do_work, tasks): -# qinput = multiprocessing.Queue() -# qres = multiprocessing.Queue() -# for t in tasks: -# qinput.put(t) -# ps = [multiprocessing.Process(target=worker, args=[do_work.func, qinput, qres], kwargs=do_work.keywords) for _ in range(self.njobs)] -# for p in ps: -# p.start() -# finish = 0 -# while finish < len(tasks): -# res = qres.get() -# if res == 'finished': -# finish += 1 -# else: -# yield res -# for p in ps: -# p.join() - -# def terminate(self): -# pass - - def find_anchors_winlen(aas, options, indexrange=None, anchors=None, **kw): """ Find multiple anchors in aa sequences for a specific word length