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:
The function returns in the last step simultaneously 100% and 100%-10^(-decimals)*1%.
The function is a modified version of the function from the source: https://stackoverflow.com/questions/3173320/text-progress-bar-in-the-console (last visited 30.11.21).
- 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