2.1.3. qmix.misc package

2.1.3.1. Submodules

2.1.3.2. qmix.misc.progbar module

This sub-module contains a function for printing a progress bar to the terminal.

Taken from:

qmix.misc.progbar.progress_bar(iteration, total, prefix='Progress:', suffix='Complete', decimals=2, bar_length=20)

Generate a progress bar.

Parameters
  • iteration (int) – current iteration

  • total (int) – total iterations

  • prefix (str, optional) – prefix string, default is “Progress:”

  • suffix (str, optional) – suffix string, default is “Complete”

  • decimals (int, optional) – number of decimals in percent complete, default is 2

  • bar_length (int, optional) – character length of bar, default is 20

2.1.3.3. qmix.misc.terminal module

This sub-module contains functions for printing numbers and text to the terminal.

qmix.misc.terminal.cprint(text, color='HEADER')

Print colored text to the terminal.

Parameters
  • text (str) – Text to print

  • color (str, optional) – Color/style to print in, default is “HEADER”

qmix.misc.terminal.header(header_string, color=None)

Print a nice header to the terminal.

Parameters
  • header_string (str) – Header title to print

  • color (str, optional) – Color to print in, default is None

qmix.misc.terminal.print_intro()

Print a quick intro to the terminal.

qmix.misc.terminal.printc(complex_number)

Print a complex number to the terminal.

Parameters

complex_number (complex) – number to print

qmix.misc.terminal.pvale(name, val, units='', comment='', color=None)

Print name, value in scientific notation and units to terminal.

Parameters
  • name (str) – variable name

  • val (float) – variable value

  • units (str, optional) – variable units, default is “”

  • comment (str, optional) – comment, default is “”

  • color (str, optional) – color, default is None

qmix.misc.terminal.pvalf(name, val, units='', comment='', color=None)

Print name, value as float, and units to terminal.

Parameters
  • name (str) – variable name

  • val (float) – variable value

  • units (str, optional) – variable units, default is “”

  • comment (str, optional) – comment, default is “”

  • color (str, optional) – color, default is None

qmix.misc.terminal.title(title_string, color=None, total_len=60)

Print a nice title to the terminal.

Parameters
  • title_string (str) – title to print

  • color (str, optional) – Color to print in, default is None

  • total_len (int, optional) – Total length of title string (including stars), default is 60

2.1.3.4. Module contents

This sub-package contains miscellaneous modules.