PyFoam.Basics.Data2DStatistics module

Data structure to do some calculations on the results from SpreadSheetData-methods metrics and compare that are organized in 2 dimensions

class PyFoam.Basics.Data2DStatistics.Data2DStatistics(metrics, compare=None, small=1e-10, noStrings=False, failureValue=None)[source]

Bases: object

Oranize statistics about data in 2D-Tables and do basic calculations on it

_Data2DStatistics__relativeErrorInternal(name)

Return a table with the relative error :param name: spcifies the name under which the error is found in the data

__dict__ = dict_proxy({'__module__': 'PyFoam.Basics.Data2DStatistics', '_extractTable': <function _extractTable>, '__getitem__': <function __getitem__>, 'relativeError': <function relativeError>, '_Data2DStatistics__relativeErrorInternal': <function __relativeErrorInternal>, 'compare': <function compare>, '_getLabels': <function _getLabels>, 'relativeAverageError': <function relativeAverageError>, 'range': <function range>, 'names': <function names>, 'func': <function func>, '_makeEmptyTable': <function _makeEmptyTable>, '__dict__': <attribute '__dict__' of 'Data2DStatistics' objects>, '__weakref__': <attribute '__weakref__' of 'Data2DStatistics' objects>, '__doc__': 'Oranize statistics about data in 2D-Tables and do basic\n calculations on it', '__init__': <function __init__>})
__getitem__(name)[source]
__init__(metrics, compare=None, small=1e-10, noStrings=False, failureValue=None)[source]
Parameters:
  • metrics – metrics of the data
  • compare – metrics of the comparsion with another data-set
  • small – the value that is considered to be close to 0
  • noStrings – only put numbers into the tables
  • failureValue – the value to use if an evaluation fails
__module__ = 'PyFoam.Basics.Data2DStatistics'
__weakref__

list of weak references to the object (if defined)

_extractTable(name, data=None)[source]

Extract data and fill it into a data-table :param name: name of the entry that should be got :param data: the dataset. If unset then self.__metrics is used

_getLabels()[source]

Return a tuple with the names of the rows and the columns. Assumes that the names for the first data-set are valid for all

_makeEmptyTable()[source]

Create an empty table to fill the data in

compare()[source]

Get a separate Data2DStatistics with the compare-data (if present)

func(func, val)[source]

Evaluate a function on the data :param func: either a callable function or a string that evaluates to a callable :param val: name of the data value to use

names()[source]

Valid data names

range()[source]

Return a table with the ranges of the data

relativeAverageError()[source]

Return a table with the relative average error

relativeError()[source]

Return a table with the relative error