From bbda76ff73b644f80eae04d05803c0fc11afed2e Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Sat, 6 Nov 2010 06:59:56 -0700 Subject: [PATCH] Ensure that self.headings exists in Histogram, e.g. in bell_rate.py's theory hist. --- pysawsim/histogram.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pysawsim/histogram.py b/pysawsim/histogram.py index c0d73b7..7591e56 100644 --- a/pysawsim/histogram.py +++ b/pysawsim/histogram.py @@ -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] -- 2.26.2