def main(): print('foo') profile = False if len(sys.argv) > 1 and sys.argv[1] == '-p': print('profiling') profile = True from PYME.mProfile import mProfile mProfile.profileOn( ['taskServerMP.py', 'HDFTaskQueue.py', 'TaskQueue.py']) Pyro.config.PYRO_MOBILE_CODE = 0 Pyro.core.initServer() ns = Pyro.naming.NameServerLocator().getNS() daemon = Pyro.core.Daemon() daemon.useNameServer(ns) # useNameServer! #check to see if we've got the TaskQueues group if not 'TaskQueues' in [n[0] for n in ns.list('')]: ns.createGroup('TaskQueues') #get rid of any previous queue try: ns.unregister(taskQueueName) except Pyro.errors.NamingError: pass tq = TaskQueueSet() uri = daemon.connect(tq, taskQueueName) tw = TaskWatcher(tq) tw.start() try: print '> taskServer start ...' daemon.requestLoop(tq.isAlive) finally: daemon.shutdown(True) tw.alive = False if profile: mProfile.report() print '> taskServer shutdown'
def main(): print('foo') profile = False if len(sys.argv) > 1 and sys.argv[1] == '-p': print('profiling') profile = True from PYME.mProfile import mProfile mProfile.profileOn(['taskServerMP.py', 'HDFTaskQueue.py', 'TaskQueue.py']) Pyro.config.PYRO_MOBILE_CODE = 0 Pyro.core.initServer() ns=Pyro.naming.NameServerLocator().getNS() daemon=Pyro.core.Daemon() daemon.useNameServer(ns) # useNameServer! #check to see if we've got the TaskQueues group if not 'TaskQueues' in [n[0] for n in ns.list('')]: ns.createGroup('TaskQueues') #get rid of any previous queue try: ns.unregister(taskQueueName) except Pyro.errors.NamingError: pass tq = TaskQueueSet() uri=daemon.connect(tq,taskQueueName) tw = TaskWatcher(tq) tw.start() try: print '> taskServer start ...' daemon.requestLoop(tq.isAlive) finally: daemon.shutdown(True) tw.alive = False if profile: mProfile.report() print '> taskServer shutdown'
class BoaApp(wx.App): def __init__(self, options, *args): self.options = options wx.App.__init__(self, *args) def OnInit(self): wx.InitAllImageHandlers() self.main = acquiremainframe.create(None, self.options) self.main.Show() self.SetTopWindow(self.main) return True def main(): from optparse import OptionParser parser = OptionParser() parser.add_option("-i", "--init-file", dest="initFile", help="Read initialisation from file [defaults to init.py]", metavar="FILE") (options, args) = parser.parse_args() application = BoaApp(options, 0) application.MainLoop() if __name__ == '__main__': from PYME import mProfile mProfile.profileOn(['previewacquisator.py']) main() mProfile.report()
# (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. # ################ __test__ = False if __name__ == '__main__': from PYME import mProfile mProfile.profileOn(['tq_block_dec.py', 'dec.py']) from PYME.DSView import View3D, ViewIm3D from PYME.DSView.image import ImageStack image = ImageStack(filename = '/data/zar_cropped.tif') data = image.data[:,:,:] psf, vs = np.load('/home/david/Desktop/id.psf') import Pyro.core import os tq = Pyro.core.getProxyForURI('PYRONAME://' + os.environ['PYME_TASKQUEUENAME']) from PYME.Deconv import tq_block_dec bd = tq_block_dec.blocking_deconv(tq, data, psf, 'foo', blocksize={'y': 128, 'x': 128, 'z': 256}, blockoverlap={'y': 10, 'x': 10, 'z': 50}) bd.go() #bd.push_deconv_tasks()
def OnInit(self): wx.InitAllImageHandlers() self.main = acquiremainframe.create(None, self.options) self.main.Show() self.SetTopWindow(self.main) return True def main(): from optparse import OptionParser parser = OptionParser() parser.add_option( "-i", "--init-file", dest="initFile", help="Read initialisation from file [defaults to init.py]", metavar="FILE") (options, args) = parser.parse_args() application = BoaApp(options, 0) application.MainLoop() if __name__ == '__main__': from PYME import mProfile mProfile.profileOn(['previewacquisator.py']) main() mProfile.report()