def displayStatistic(statistic, state): """The function displays selected statistic for the current state. :param statistic: name of the statistic to display :param state: the current application state """ print( bacteria.dataStatistics(applyFilters(state['data'], state['filters']), statistic))
def testMeanTempStatistic(self): data = bacteria.dataLoad('test.txt') self.assertAlmostEqual(38.79, bacteria.dataStatistics(data, "Mean Temperature"), delta=0.01)
def testRows(self): data = bacteria.dataLoad('test.txt') self.assertEqual(63, bacteria.dataStatistics(data, "Rows"))
def testMeanHotGrowthRate(self): data = bacteria.dataLoad('test.txt') self.assertAlmostEqual(0.39, bacteria.dataStatistics(data, "Mean Hot Growth rate"), delta=0.01)
def testStdTemp(self): data = bacteria.dataLoad('test.txt') self.assertAlmostEqual(13.27, bacteria.dataStatistics(data, "Std Temperature"), delta=0.01)