starting work on multibar
This commit is contained in:
@@ -576,7 +576,7 @@ envelope_rules = default_rules + [
|
||||
Rule("gamma_op", lambda: operators.constant_quantity(0.0), priorities=-1),
|
||||
Rule("ss_op", lambda w_c, w0: operators.constant_quantity(w_c / w0)),
|
||||
Rule("ss_op", lambda: operators.constant_quantity(0), priorities=-1),
|
||||
Rule("spm_op", operators.envelope_spm),
|
||||
Rule("spm_op", operators.envelope_spm, conditions=dict(spm=True)),
|
||||
Rule("spm_op", operators.no_op_freq, priorities=-1),
|
||||
Rule("raman_op", operators.envelope_raman),
|
||||
Rule("raman_op", operators.no_op_freq, priorities=-1),
|
||||
|
||||
18
src/scgenerator/threading.py
Normal file
18
src/scgenerator/threading.py
Normal file
@@ -0,0 +1,18 @@
|
||||
from multiprocessing import Process, Queue
|
||||
from threading import Thread
|
||||
from tqdm import tqdm
|
||||
|
||||
class Multibar(Thread):
|
||||
queue: Queue
|
||||
bars:list[tqdm]
|
||||
def __init__(self, bars:list[tqdm], queue:Queue):
|
||||
self.queue = queue
|
||||
self.bars = bars
|
||||
|
||||
def run(self):
|
||||
while True:
|
||||
bar_id, amount = self.queue.get(True, None)
|
||||
self.bars[bar_id].update(amount)
|
||||
self.bars[0].update(amount)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user