Functions
utilities Namespace Reference

Functions

def progressBar (value, endvalue, bar_length=40, msg='Progress')
 

Function Documentation

def utilities.progressBar (   value,
  endvalue,
  bar_length = 40,
  msg = 'Progress' 
)

Definition at line 13 of file utilities.py.

References check_time_usage.float, novadaq::HexUtils.format(), makeTrainCVSamples.int, and stan::math.round().

Referenced by garching_flux_to_genie_root.main().

13 def progressBar(value, endvalue, bar_length = 40, msg = 'Progress'):
14  percent = float(value) / endvalue
15  arrow = '=' * int(round(percent * bar_length) - 1) + '>'
16  spaces = ' ' * (bar_length - len(arrow))
17 
18  sys.stdout.write("\r{0}: [\033[01;32m{1}\033[00m] {2}/{3} ({4}%)".format(msg, arrow + spaces, value, endvalue - 1, int(round(percent * 100))))
19  sys.stdout.flush()
20 
def progressBar(value, endvalue, bar_length=40, msg='Progress')
Definition: utilities.py:13
fvar< T > round(const fvar< T > &x)
Definition: round.hpp:23
std::string format(const int32_t &value, const int &ndigits=8)
Definition: HexUtils.cpp:14