Relax precision in pysawsim.histogram.Histogram bin_edges doctest.
[sawsim.git] / pysawsim / histogram.py
index c0d73b75c0fdd3a8810af5ceaf8fdcb8135d9e29..acd135955e1223df0a0b0f591ceb8849cee54230 100644 (file)
@@ -35,6 +35,9 @@ class Histogram (object):
 
     >>> h = Histogram()
     """
+    def __init__(self):
+        self.headings = None
+
     def calculate_bin_edges(self, data, bin_width):
         """
         >>> h = Histogram()
@@ -60,7 +63,6 @@ class Histogram (object):
         All bins should be of equal width (so we can calculate which
         bin a data point belongs to).
         """
-        self.headings = None
         data = numpy.array(data)
         self.bin_edges = numpy.array(bin_edges)
         bin_width = self.bin_edges[1] - self.bin_edges[0]
@@ -102,7 +104,7 @@ class Histogram (object):
         >>> h.counts
         [10.0, 40.0, 5.0]
         >>> h.bin_edges  # doctest: +ELLIPSIS
-        [1.5e-10, 2.000...e-10, 2.500...e-10, 3e-10]
+        [1.5e-10, 2...e-10, 2.5...e-10, 3e-10]
         >>> h.probabilities  # doctest: +ELLIPSIS
         [0.181..., 0.727..., 0.0909...]
         """