コード例 #1
0
ファイル: main.py プロジェクト: andysgrabek/02633_project1
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))
コード例 #2
0
 def testMeanTempStatistic(self):
     data = bacteria.dataLoad('test.txt')
     self.assertAlmostEqual(38.79,
                            bacteria.dataStatistics(data,
                                                    "Mean Temperature"),
                            delta=0.01)
コード例 #3
0
 def testRows(self):
     data = bacteria.dataLoad('test.txt')
     self.assertEqual(63, bacteria.dataStatistics(data, "Rows"))
コード例 #4
0
 def testMeanHotGrowthRate(self):
     data = bacteria.dataLoad('test.txt')
     self.assertAlmostEqual(0.39,
                            bacteria.dataStatistics(data,
                                                    "Mean Hot Growth rate"),
                            delta=0.01)
コード例 #5
0
 def testStdTemp(self):
     data = bacteria.dataLoad('test.txt')
     self.assertAlmostEqual(13.27,
                            bacteria.dataStatistics(data,
                                                    "Std Temperature"),
                            delta=0.01)