Ignore:
Timestamp:
Apr 7, 2017 10:36:17 AM (8 years ago)
Author:
Tim Snow <tim.snow@…>
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, magnetic_scatt, release-4.2.2, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
be7264f1
Parents:
503eb52
Message:

Removed 'non-Pythonic' variable names

As per Quantified Code warnings, however, unsure why ‘from time import
time’ comes up as an error.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/sasgui/perspectives/fitting/basepage.py

    r503eb52 ra0469a1  
    243243 
    244244        # Setting up a thread for the fitting 
    245         self.threadedDrawQueue = Queue() 
    246  
    247         self.threadedDrawWorker = Thread(target = self._threaded_draw_worker, 
    248                                          args = (self.threadedDrawQueue,)) 
    249         self.threadedDrawWorker.setDaemon(True) 
    250         self.threadedDrawWorker.start() 
     245        self.threaded_draw_queue = Queue() 
     246 
     247        self.draw_worker_thread = Thread(target = self._threaded_draw_worker, 
     248                                         args = (self.threaded_draw_queue,)) 
     249        self.draw_worker_thread.setDaemon(True) 
     250        self.draw_worker_thread.start() 
    251251 
    252252        # And a home for the thread submission times 
    253         self.lastTimeFitSubmitted = 0.00 
     253        self.last_time_fit_submitted = 0.00 
    254254 
    255255    def set_index_model(self, index): 
     
    17061706        """ 
    17071707        # Get the time 
    1708         currentTime = time() 
     1708        current_time = time() 
    17091709 
    17101710        # When loading we slam a number of fits through here 
    17111711        # let's filter these out to start with 
    1712         if currentTime > (self.lastTimeFitSubmitted + 0.1): 
     1712        if current_time > (self.last_time_fit_submitted + 0.1): 
    17131713            # Submitting the rest 
    1714             self.threadedDrawQueue.put([update_chisqr, source]) 
     1714            self.threaded_draw_queue.put([update_chisqr, source]) 
    17151715        else: 
    17161716            pass 
    17171717 
    1718         self.lastTimeFitSubmitted = currentTime 
    1719  
    1720     def _threaded_draw_worker(self, threadedDrawQueue): 
     1718        self.last_time_fit_submitted = current_time 
     1719 
     1720    def _threaded_draw_worker(self, threaded_draw_queue): 
    17211721        while True: 
    17221722            # Check to see is a manager is running and a calc is running 
     
    17261726                # If a manager is running a calculation  
    17271727                # then trim the queue 
    1728                 if self.threadedDrawQueue.qsize() > 1: 
    1729                     for loopIter in range(threadedDrawQueue.qsize() - 1): 
    1730                         dump = self.threadedDrawQueue.get() 
    1731                         self.threadedDrawQueue.task_done() 
     1728                if self.threaded_draw_queue.qsize() > 1: 
     1729                    for loopIter in range(threaded_draw_queue.qsize() - 1): 
     1730                        dump = self.threaded_draw_queue.get() 
     1731                        self.threaded_draw_queue.task_done() 
    17321732            else: 
    17331733                # Otherwise, just run 
    1734                 inputVariables = threadedDrawQueue.get() 
    1735                 self._draw_model_after(inputVariables[0], inputVariables[1]) 
     1734                input_variables = threaded_draw_queue.get() 
     1735                self._draw_model_after(input_variables[0], input_variables[1]) 
    17361736                wx.PostEvent(self._manager.parent, StatusEvent(status =  
    17371737                            "Computation is in progress...", type = "progress")) 
    1738                 threadedDrawQueue.task_done() 
     1738                threaded_draw_queue.task_done() 
    17391739 
    17401740    def _draw_model_after(self, update_chisqr=True, source='model'): 
Note: See TracChangeset for help on using the changeset viewer.