From 2be4d17da41459a83d727867994de51560165caa Mon Sep 17 00:00:00 2001 From: Abhinav Rai Date: Sun, 16 Apr 2017 21:40:36 +0530 Subject: [PATCH] Replace dump() with define __str__ in AdaptiveScalarEncoder. Issue #1518 --- src/nupic/encoders/adaptivescalar.py | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/src/nupic/encoders/adaptivescalar.py b/src/nupic/encoders/adaptivescalar.py index 6f8f70fb55..e11bdbf753 100644 --- a/src/nupic/encoders/adaptivescalar.py +++ b/src/nupic/encoders/adaptivescalar.py @@ -195,22 +195,9 @@ def topDownCompute(self, encoded): return super(AdaptiveScalarEncoder, self).topDownCompute(encoded) - def dump(self): - """ - Prints details about current state to stdout. - """ - print "AdaptiveScalarEncoder:" - print " min: %f" % self.minval - print " max: %f" % self.maxval - print " w: %d" % self.w - print " n: %d" % self.n - print " resolution: %f" % self.resolution - print " radius: %f" % self.radius - print " periodic: %s" % self.periodic - print " nInternal: %d" % self.nInternal - print " rangeInternal: %f" % self.rangeInternal - print " padding: %d" % self.padding - + def __str__(self): + return "AdaptiveScalarEncoder\nmin: %f\nmax: %f\nw: %d\nn: %d\nresolution: %f\nradius: %f\nperiodic: %f\nnInternal: %f\nrangeInternal: %f\npadding: %d" \ + % (self.minval, self.maxval, self.w, self.n, self.resolution, self.radius, self.periodic, self.nInternal, self.rangeInternal, self.padding) @classmethod def read(cls, proto):