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

updated __init__.py to include missing encoders #3487

Merged
merged 7 commits into from
May 22, 2017

Conversation

JonnoFTW
Copy link
Contributor

@JonnoFTW JonnoFTW commented Mar 10, 2017

Fixes #3480

Also fixed absolute package path for the PassThroughEncoder

Copy link
Member

@rhyolight rhyolight left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please update the import statements in

  • unit/nupic/encoders/random_distributed_scalar_test.py
  • unit/nupic/encoders/pass_through_encoder_test.py
  • unit/nupic/encoders/sparse_pass_through_encoder_test.py
  • nupic/encoders/multi.py

@JonnoFTW
Copy link
Contributor Author

@rhyolight What did you want changed in multi.py? Do you want all the imports to use the format:

from nupic.encoders import ScalarEncoder

@rhyolight
Copy link
Member

rhyolight commented Mar 12, 2017 via email

@rhyolight
Copy link
Member

Interesting test failure (some in all CI platforms)... 🤔

==================================== ERRORS ====================================
_______ ERROR collecting tests/unit/nupic/algorithms/sp_overlap_test.py ________
tests/unit/nupic/algorithms/sp_overlap_test.py:41: in <module>
    from nupic.encoders import scalar
venv/lib/python2.7/site-packages/nupic/encoders/__init__.py:36: in <module>
    from multi import MultiEncoder
venv/lib/python2.7/site-packages/nupic/encoders/multi.py:36: in <module>
    from nupic.encoders import bitsToString
E   ImportError: cannot import name bitsToString

@JonnoFTW
Copy link
Contributor Author

@rhyolight I fixed the error, but now I get capnp errors:

____________________________________________________________________________________ ERROR collecting tests/unit/nupic/encoders/multi_test.py ____________________________________________________________________________________
tests/unit/nupic/encoders/multi_test.py:37: in <module>
    from nupic.encoders.multi_capnp import MultiEncoderProto
capnp/lib/capnp.pyx:3876: in capnp.lib.capnp._Loader.load_module (capnp/lib/capnp.cpp:78463)
    ???
capnp/lib/capnp.pyx:3855: in capnp.lib.capnp.load (capnp/lib/capnp.cpp:77938)
    ???
capnp/lib/capnp.pyx:3192: in capnp.lib.capnp.SchemaParser.load (capnp/lib/capnp.cpp:68839)
    ???
E   KjException: /home/CSEM/mack0242/.pyenv/versions/2.7.12/lib/python2.7/site-packages/nupic-0.5.8.dev0-py2.7.egg/nupic/encoders/adaptivescalar.capnp:0: failed: Duplicate ID @0xf11485b8c813b489.
E   stack: 0x7f79e78dbf68 0x7f79e82dc3e9 0x7f79e82dbf2a 0x7f79e82d2a1a 0x7f79e82d2f52 0x7f79e82d7346 0x7f79e82d743b 0x7f79e82d74fc 0x7f79e82d7544 0x7f79e82b7ff9 0x7f79e82b7246 0x7f79e82bb4ac 0x7f79e82cf945 0x7f79e82d72ce 0x7f79e82d056e 0x7f79e82d0877

Are these errors acceptable?

@rhyolight
Copy link
Member

Oh, I did not expect that. @vitaly-krugl can you explain this at all? Seems like import changes should not affect capnp.

@rhyolight
Copy link
Member

@JonnoFTW Can you merge in master and see if the builds pass?

JonnoFTW added 3 commits May 19, 2017 12:02
Conflicts:
	src/nupic/encoders/__init__.py
	src/nupic/encoders/multi.py
	tests/unit/nupic/encoders/pass_through_encoder_test.py
	tests/unit/nupic/encoders/sparse_pass_through_encoder_test.py
@JonnoFTW
Copy link
Contributor Author

@rhyolight can you have a look at this now?

Copy link
Member

@rhyolight rhyolight left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I didn't catch this earlier.

from nupic.encoders import PassThroughEncoder
from nupic.encoders import SparsePassThroughEncoder
from nupic.encoders import CoordinateEncoder
from nupic.encoders import GeospatialCoordinateEncoder
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to our style guide, please import all encoders enclosed in parentheses to allow multiple lines.

@rhyolight
Copy link
Member

Thanks Jonathan!

@rhyolight rhyolight merged commit 99856ea into numenta:master May 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RandomDistributedScalarEncoder and SparsePassThroughEncoder are missing from nupic.encoders __init__.py
2 participants