info.py (1269:419b73347a1e) info.py (1301:f85f6fb43474)
1from __future__ import division
2import operator, re, types
3
4source = None
5display_run = 0
6
7def issequence(t):
8 return isinstance(t, types.TupleType) or isinstance(t, types.ListType)

--- 138 unchanged lines hidden (view full) ---

147 else:
148 return super(Statistic, self).__getattribute__(attr)
149
150 def __setattr__(self, attr, value):
151 if attr == 'bins' or attr == 'ticks':
152 if attr == 'bins':
153 if value is not None:
154 value = source.getBin(value)
1from __future__ import division
2import operator, re, types
3
4source = None
5display_run = 0
6
7def issequence(t):
8 return isinstance(t, types.TupleType) or isinstance(t, types.ListType)

--- 138 unchanged lines hidden (view full) ---

147 else:
148 return super(Statistic, self).__getattribute__(attr)
149
150 def __setattr__(self, attr, value):
151 if attr == 'bins' or attr == 'ticks':
152 if attr == 'bins':
153 if value is not None:
154 value = source.getBin(value)
155 elif attr == 'samples' and type(value) is str:
155 elif attr == 'ticks' and type(value) is str:
156 value = [ int(x) for x in value.split() ]
157
158 self.__dict__[attr] = value
159 self.__dict__['value'] = None
160 else:
161 super(Statistic, self).__setattr__(attr, value)
162
163 def getValue(self):

--- 83 unchanged lines hidden (view full) ---

247 d.desc = 'formula'
248 val = self.value[display_run]
249 d.value = [ val[x][0] for x in val.keys() ]
250 d.display()
251
252
253class Scalar(Statistic,FormulaStat):
254 def getValue(self):
156 value = [ int(x) for x in value.split() ]
157
158 self.__dict__[attr] = value
159 self.__dict__['value'] = None
160 else:
161 super(Statistic, self).__setattr__(attr, value)
162
163 def getValue(self):

--- 83 unchanged lines hidden (view full) ---

247 d.desc = 'formula'
248 val = self.value[display_run]
249 d.value = [ val[x][0] for x in val.keys() ]
250 d.display()
251
252
253class Scalar(Statistic,FormulaStat):
254 def getValue(self):
255 return source.data(self, self.bins)
255 return source.data(self, self.bins, self.ticks)
256
257 def display(self):
258 import display
259 p = display.Print()
260 p.name = self.name
261 p.desc = self.desc
262 p.value = float(self)
263 p.flags = self.flags

--- 458 unchanged lines hidden ---
256
257 def display(self):
258 import display
259 p = display.Print()
260 p.name = self.name
261 p.desc = self.desc
262 p.value = float(self)
263 p.flags = self.flags

--- 458 unchanged lines hidden ---