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

Remove Base Encoder.formatBits() function #3581

Closed
rhyolight opened this issue May 3, 2017 · 0 comments
Closed

Remove Base Encoder.formatBits() function #3581

rhyolight opened this issue May 3, 2017 · 0 comments
Assignees

Comments

@rhyolight
Copy link
Member

rhyolight commented May 3, 2017

This function is defined on the base encoder class, so is available for all encoder subclasses, but is never called within our codebase. It seems to be entirely for displaying SDRs in a console log.

https://github.com/numenta/nupic/blob/8d97b2b1e8be99fbb6d753ddca1e168e4c416028/src/nupic/encoders/base.py#L770-L791

I suggest we remove it entirely, for several reasons:

  • it is not used anywhere
  • there are no examples of usage
  • documentation is incomplete
  • it doesn't work

I tried to use it, and it did not work as I expected when I added more than one sub-field in the encoder description. This script yielded an error:

[('test formatBits 1', 0), ('test formatBits 2', 3), ('end', 10)]
Copying: [1, 0, 1]
Traceback (most recent call last):
  File "format_bits_test.py", line 30, in <module>
    formatBits(width, desc, input, output, scale=1)
  File "format_bits_test.py", line 23, in formatBits
    outarray[end+i+leftpad] = blank
IndexError: list assignment index out of range

(I printed out the description before it was looped.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant