Пример #1
0
    def test_stats(self):
        data = [(50, 0), (-50, 0), (0, -50), (0, 50)]
        data = [pgh.encode(lat, lon) for lat, lon in data]

        # mean
        mean = pgh.mean(data)
        self.assertEqual(mean, '7zzzzzzzzzzz')

        # north
        north = pgh.northern(data)
        self.assertEqual(north, 'gbzurypzpgxc')

        # south
        south = pgh.southern(data)
        self.assertEqual(south, '5zpgxczbzury')

        # east
        east = pgh.eastern(data)
        self.assertEqual(east, 'mpgxczbzuryp')

        # west
        west = pgh.western(data)
        self.assertEqual(west, '6zurypzpgxcz')

        var = pgh.variance(data)
        self.assertAlmostEqual(var, 30910779278721.996, places=2)

        std = pgh.std(data)
        self.assertAlmostEqual(std, 5559746.332227937, places=4)
Пример #2
0
    def test_stats(self):
        data = [(50, 0), (-50, 0), (0, -50), (0, 50)]
        data = [pgh.encode(lat, lon) for lat, lon in data]

        # mean
        mean = pgh.mean(data)
        self.assertEqual(mean, '7zzzzzzzzzzz')

        # north
        north = pgh.northern(data)
        self.assertEqual(north, 'gbzurypzpgxc')

        # south
        south = pgh.southern(data)
        self.assertEqual(south, '5zpgxczbzury')

        # east
        east = pgh.eastern(data)
        self.assertEqual(east, 'mpgxczbzuryp')

        # west
        west = pgh.western(data)
        self.assertEqual(west, '6zurypzpgxcz')

        var = pgh.variance(data)
        self.assertAlmostEqual(var, 30910779278721.996, places=2)

        std = pgh.std(data)
        self.assertAlmostEqual(std, 5559746.332227937, places=4)
Пример #3
0
    def test_stats(self):
        data = [(50, 0), (-50, 0), (0, -50), (0, 50)]
        data = [pgh.encode(lat, lon) for lat, lon in data]

        # mean
        mean = pgh.mean(data)
        self.assertEqual(mean, '7zzzzzzzzzzz')

        # north
        north = pgh.northern(data)
        self.assertEqual(north, 'gbzurypzpgxc')

        # south
        south = pgh.southern(data)
        self.assertEqual(south, '5zpgxczbzury')

        # east
        east = pgh.eastern(data)
        self.assertEqual(east, 'mpgxczbzuryp')

        # west
        west = pgh.western(data)
        self.assertEqual(west, '6zurypzpgxcz')