pele-python / mcpele

Monte Carlo and parallel tempering routines built on the pele foundation
Other
20 stars 5 forks source link

start timing at construction of progress instance #27

Closed kjs73 closed 10 years ago

kjs73 commented 10 years ago

Change progress class such that time of construction is zero. In the previous version time of program start is zero which can give problems if this is significantly earlier than construction of the progress object (estimated times are off).

smcantab commented 10 years ago

maybe we can modify the output so that it doesn't print on multiple lines but the updates come on the same lines? as if it was a bar. There are a bunch of examples on how to do that on stack overflow. This is not urgent, so we can leave it for now, but it should be relatively easy to do.

kjs73 commented 10 years ago

This is a very good idea! I forgot about that...

kjs73 commented 10 years ago

OK, it should be fine now. Output is in single line which overwrites what was there before. There are two slightly inconvenient things:

  1. If there is other output happening, there will be a mess until the next time progress writes something.
  2. If the size of the progress line shrinks too much, the line may be only partially overwritten (gives funny value of the year in the formatted time at line end). But I think these two problems are not too bad. (1) goes away by itself at next output and (2) is fixed now by adding some spaces at the end of the line.
smcantab commented 10 years ago

Awesome! On 24 Jul 2014 07:31, "kjs73" notifications@github.com wrote:

OK, it should be fine now. Output is in single line which overwrites what was there before. There are two slightly inconvenient things:

  1. If there is other output happening, there will be a mess until the next time progress writes something.
  2. If the size of the progress line shrinks too much, the line may be only partially overwritten (gives funny value of the year in the formatted time at line end). But I think these two problems are not too bad. (1) goes away by itself at next output and (2) is fixed now by adding some spaces at the end of the line.

— Reply to this email directly or view it on GitHub https://github.com/pele-python/mcpele/pull/27#issuecomment-49996468.