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__ = mappingproxy({'__weakref__': <attribute '__weakref__' of 'Data2DStatistics' objects>, '__init__': <function Data2DStatistics.__init__>, '__doc__': 'Oranize statistics about data in 2D-Tables and do basic\n calculations on it', '_getLabels': <function Data2DStatistics._getLabels>, 'func': <function Data2DStatistics.func>, 'compare': <function Data2DStatistics.compare>, '_makeEmptyTable': <function Data2DStatistics._makeEmptyTable>, 'relativeError': <function Data2DStatistics.relativeError>, '_Data2DStatistics__relativeErrorInternal': <function Data2DStatistics.__relativeErrorInternal>, '__getitem__': <function Data2DStatistics.__getitem__>, '__module__': 'PyFoam.Basics.Data2DStatistics', '__dict__': <attribute '__dict__' of 'Data2DStatistics' objects>, '_extractTable': <function Data2DStatistics._extractTable>, 'relativeAverageError': <function Data2DStatistics.relativeAverageError>, 'names': <function Data2DStatistics.names>, 'range': <function Data2DStatistics.range>})
__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