annotate tests/test_histogram.py @ 68:07362c531a7e

stub histogram tests
author Jeff Hammel <k0scist@gmail.com>
date Sat, 28 Feb 2015 16:13:14 -0800
parents
children 8e93d7357c6b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
68
07362c531a7e stub histogram tests
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
1 #!/usr/bin/env python
07362c531a7e stub histogram tests
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
2 # -*- coding: utf-8 -*-
07362c531a7e stub histogram tests
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
3
07362c531a7e stub histogram tests
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
4 """
07362c531a7e stub histogram tests
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
5 unit tests for histograms
07362c531a7e stub histogram tests
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
6 """
07362c531a7e stub histogram tests
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
7
07362c531a7e stub histogram tests
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
8 import os
07362c531a7e stub histogram tests
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
9 import sys
07362c531a7e stub histogram tests
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
10 import unittest
07362c531a7e stub histogram tests
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
11 from numerics.histogram import Histogram
07362c531a7e stub histogram tests
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
12
07362c531a7e stub histogram tests
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
13 # globals
07362c531a7e stub histogram tests
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
14 here = os.path.dirname(os.path.abspath(__file__))
07362c531a7e stub histogram tests
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
15
07362c531a7e stub histogram tests
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
16 class HistogramUnitTest(unittest.TestCase):
07362c531a7e stub histogram tests
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
17
07362c531a7e stub histogram tests
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
18 def test_histogram(self):
07362c531a7e stub histogram tests
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
19 """basic histogram test"""
07362c531a7e stub histogram tests
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
20
07362c531a7e stub histogram tests
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
21 # make some test data
07362c531a7e stub histogram tests
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
22 data = [0,0,1,1,2,3,4,5,6,7,8,8,8]
07362c531a7e stub histogram tests
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
23 bins = range(0,10)
07362c531a7e stub histogram tests
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
24
07362c531a7e stub histogram tests
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
25 # make a histogram
07362c531a7e stub histogram tests
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
26 h = Histogram(bins)
07362c531a7e stub histogram tests
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
27
07362c531a7e stub histogram tests
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
28 if __name__ == '__main__':
07362c531a7e stub histogram tests
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
29 unittest.main()
07362c531a7e stub histogram tests
Jeff Hammel <k0scist@gmail.com>
parents:
diff changeset
30