You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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---
frommantid.kernelimport*frommantid.apiimport*classFibSeq(PythonAlgorithm):
defcategory(self):
return"A_MyTools"defPyInit(self):
# Declare propertiesself.declareProperty('NTerms', -1, IntBoundedValidator(lower=0) ,doc='the number of terms to iterate')
defPyExec(self):
# Run the algorithm#get the valuemaxAllowed=100000;
nterms=self.getProperty("NTerms").valueifnterms>maxAllowed:
raiseRuntimeError("Number of tems must be less than "+str(maxAllowed))
prev_2, prev_1=0,1http://trac.mantidproject.org/mantid/ticket/0termscaseifnterms==0:
returnself.log().debug("Term 1 in the Fibonacci series is: "+str(prev_2))
http://trac.mantidproject.org/mantid/ticket/1termcaseifnterms==1:
returnself.log().debug("Term 2 in the Fibonacci series is: "+str(prev_1))
prog_reporter=Progress(self, start=0.0, end=1.0, nreports=nterms)
foriinrange (0,nterms-1):
current=prev_2+prev_1self.log().debug("Term "+str(i+2)+" in the Fibonacci series is: "+str(current))
prev_2=prev_1prev_1=currentprog_reporter.report("Processing")
importtimetime.sleep(2)
# Register algorithm with MantidAlgorithmFactory.subscribe(FibSeq)
The text was updated successfully, but these errors were encountered:
This issue was originally TRAC 8696
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---
The text was updated successfully, but these errors were encountered: