From: W. Trevor King Date: Sat, 6 Nov 2010 13:59:56 +0000 (-0700) Subject: Ensure that self.headings exists in Histogram, e.g. in bell_rate.py's theory hist. X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=bbda76ff73b644f80eae04d05803c0fc11afed2e;p=sawsim.git Ensure that self.headings exists in Histogram, e.g. in bell_rate.py's theory hist. --- 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]