2.1.1. drrc.tools.general_methods module

Code author: Luk Fleddermann

This file contains general (usefull) classes and functions, which can be used in a more general application than the simulation and prediction of spatially extended systems.

class progress_feedback[source]

Bases: object

The class includes different featback functions which can be used to obtain featback for itterative aplications of similar steps. Some of which are reused from userbased function definitions.

static printProgressBar(iteration, total, prefix='', suffix='', decimals=1, length=100, fill='█', printEnd='\r', name=None)[source]
Args:

iteration: current iteration (Int) total: total iterations (Int) prefix: prefix string (Str) suffix: suffix string (Str) decimals: positive number of decimals in percent complete (Int) length: character length of bar (Int) fill: bar fill character (Str) printEnd: end character (e.g. “

“, ” “) (Str)

Notes:
static print_percent_of_saved_frames(i, n, printEnd='\r')[source]
Parameters:
  • iteration – current iteration (Int)

  • total – total iterations (Int)

error_calculation(Prediction: ndarray, Truth: ndarray, mean_value: ndarray | None = None)[source]

Calculates the Mean-Sqauare-Error, Root-Mean-Square-Error and the Normalised-Root-Mean-Square-Error between two given arrays and a mean_value.

Parameters:
  • Prediction – Array from which the deviation to the second array is measured.

  • truth – The truth from which the deviation is measured.

  • mean_value – The temporal mean value of a the truth. Optionally also a mean over systemdimensions can be taken reducing the mean_value to a float number. If ‘None’ the mean value of truth (over temp. domain only) is taken.

Returns:

  • Mean-Sqauare-Error

  • Root-Mean-Square-Error

  • Normalised-Root-Mean-Square-Error

_get_path()[source]
Returns:

current Path