Commits

Georg Brandl committed d4cf88b

param: make __repr__ a little more useful

Comments (0)

Files changed (2)

ufit/models/base.py

             self._real_fcn(x, *(p[pv] for pv in pvs))
 
     def get_description(self):
-        return 'Function[%s, %s]' % (self.name, self._real_fcn.func_name)
+        return 'Function(%s, %s)' % (self.name, self._real_fcn.func_name)
 
 
 class GlobalModel(Model):
         return s
 
     def __repr__(self):
-        return '<Param %s>' % self
+        if self.expr:
+            return '<Param %s = %.5g (expr: %s)>' % (
+                self.name, self.value, self.expr)
+        return '<Param %s = %.5g +/- %s>' % (
+            self.name, self.value, self.error)
 
 
 # XXX replace by something more safe later