Ticket #8696 (assigned)

Opened 7 years ago

Last modified 5 years ago

Process bar reporting misleading when output lots of logging

Reported by: Anders Markvardsen Owned by:
Priority: major Milestone: Backlog
Component: Framework Keywords:
Cc: tom.griffin@… Blocked By:
Blocking: Tester:

Description

Suggest for enhancement is to have the reported time in the log be in sync with the reported time by the process bar

See report by Tom Griffin below.

Running the script below with nterms > 5000. Reported execution time is very low <0.1s in the log for the algorithm Progress bar is displayed for >2s

---Code below---

from mantid.kernel import * from mantid.api import *

class FibSeq(PythonAlgorithm):

def category(self):

return "A_MyTools"

def PyInit(self):

# Declare properties self.declareProperty('NTerms', -1, IntBoundedValidator(lower=0) ,doc='the number of terms to iterate')

def PyExec(self):

# Run the algorithm #get the value maxAllowed = 100000; nterms = self.getProperty("NTerms").value

if nterms > maxAllowed:

raise RuntimeError("Number of tems must be less than " + str(maxAllowed))

prev_2, prev_1 = 0,1

#0 terms case if nterms ==0:

return

self.log().debug("Term 1 in the Fibonacci series is: " + str(prev_2))

#1 term case if nterms == 1:

return

self.log().debug("Term 2 in the Fibonacci series is: " + str(prev_1))

prog_reporter = Progress(self, start=0.0, end=1.0, nreports=nterms)

for i in range (0,nterms-1):

current = prev_2+prev_1 self.log().debug("Term " + str(i+2)+ " in the Fibonacci series is: " + str(current)) prev_2=prev_1 prev_1=current prog_reporter.report("Processing")

import time time.sleep(2)

# Register algorithm with Mantid AlgorithmFactory.subscribe(FibSeq)

Change History

comment:1 Changed 7 years ago by Nick Draper

  • Status changed from new to assigned

bulk move to assigned at the into of the triage step

comment:2 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 9540

Note: See TracTickets for help on using tickets.