GitLab will be upgraded on June 23rd evening. During the upgrade the service will be unavailable, sorry for the inconvenience.

Commit 9e8df4e1 authored by Thomas Vincent's avatar Thomas Vincent

minor code reword

parent 2a181683
......@@ -31,8 +31,9 @@ __date__ = "01/06/2016"
__license__ = "MIT"
import logging
import functools
import ctypes
import multiprocessing as mp
import multiprocessing
from threading import Thread
import multiprocessing.sharedctypes as mp_sharedctypes
from silx.math.fit import snip1d
......@@ -115,7 +116,6 @@ class PeakFitter(Thread):
self.__results = None
self.__thread = None
self.__progress = 0
self.__callback = None
self.__status = self.READY
......@@ -177,9 +177,9 @@ class PeakFitter(Thread):
if blocking:
return self.__peak_fit()
else:
thread = self.__thread = Thread(target=self.__peak_fit)
self.__thread = Thread(target=self.__peak_fit)
self.__callback = callback
thread.start()
self.__thread.start()
def progress(self):
return (100.0 *
......@@ -193,10 +193,7 @@ class PeakFitter(Thread):
progress = np.frombuffer(self.__shared_progress, dtype='int32')
progress[:] = 0
# TODO check file exists and can be opened
import functools
pool = mp.Pool(self.__n_proc)
pool = multiprocessing.Pool(self.__n_proc)
fit_results = pool.map(
functools.partial(_fit_process,
qspace_f=self.__qspace_f,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment