Skip to content
This repository has been archived by the owner on Sep 1, 2023. It is now read-only.

Commit

Permalink
Merge pull request #2764 from scottpurdy/coordinate-tests
Browse files Browse the repository at this point in the history
Adds basic unit test for CoordinateEncoder._hashCoordinate.
  • Loading branch information
scottpurdy committed Nov 20, 2015
2 parents 00d9573 + 3e8b116 commit ab2039f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/unit/nupic/encoders/coordinate_test.py
Expand Up @@ -75,6 +75,13 @@ def testInvalidN(self):
self.assertRaises(ValueError, CoordinateEncoder, **args)


def testHashCoordinate(self):
h1 = self.encoder._hashCoordinate(np.array([0]))
self.assertEqual(h1, 7415141576215061722)
h2 = self.encoder._hashCoordinate(np.array([0, 1]))
self.assertEqual(h2, 6909411824118942936)


def testOrderForCoordinate(self):
h1 = self.encoder._orderForCoordinate(np.array([2, 5, 10]))
h2 = self.encoder._orderForCoordinate(np.array([2, 5, 11]))
Expand Down

0 comments on commit ab2039f

Please sign in to comment.