Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Process bar reporting misleading when output lots of logging #9540

Closed
Anders-Markvardsen opened this issue Jan 13, 2014 · 2 comments
Closed
Labels
Framework Issues and pull requests related to components in the Framework

Comments

@Anders-Markvardsen
Copy link
Member

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---

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

                                http://trac.mantidproject.org/mantid/ticket/0 terms case
                                if nterms ==0:
                                                return

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

                                http://trac.mantidproject.org/mantid/ticket/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)
@Anders-Markvardsen
Copy link
Member Author

@NickDraper (2014-02-14T11:07:55):
bulk move to assigned at the into of the triage step

@Anders-Markvardsen Anders-Markvardsen added the Framework Issues and pull requests related to components in the Framework label Jun 3, 2015
@NickDraper
Copy link
Contributor

Lots of logging is bad, and the progress time is only intended to be an indicator.

Wontfix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Framework Issues and pull requests related to components in the Framework
Projects
None yet
Development

No branches or pull requests

2 participants