Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removes base.Encoder.formatBits() #3582

Merged
merged 1 commit into from
May 3, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 0 additions & 24 deletions src/nupic/encoders/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -765,27 +765,3 @@ def getDisplayWidth(self):
"""
width = self.getWidth() + len(self.getDescription()) - 1
return width


def formatBits(self, inarray, outarray, scale=1, blank=255, leftpad=0):
"""
Copy one array to another, inserting blanks between fields (for display).
If ``leftpad`` is one, then there is a dummy value at element 0
of the arrays, and we should start our counting from 1 rather than 0.

:param inarray: TODO: document
:param outarray: TODO: document
:param scale: TODO: document
:param blank: TODO: document
:param leftpad: TODO: document
"""
description = self.getDescription() + [("end", self.getWidth())]

# copy the data, but put one blank in between each field
for i in xrange(len(description) - 1):
start = description[i][1]
end = description[i+1][1]
# print "Copying: %s" % inarray[start:end]
outarray[start+i+leftpad:end+i+leftpad] = inarray[(start+leftpad):(end+leftpad)] * scale
if end < self.getWidth():
outarray[end+i+leftpad] = blank