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

Revert swig version back to 3.0.2 and add test checking network parameters #1407

Merged
merged 2 commits into from
Mar 21, 2018

Conversation

lscheinkman
Copy link
Contributor

When installing the latest versions of nupic and nupic.core directly from master the test unified_py_parameter_test/testScalars fails with the following error:

self = <tests.unit.nupic.engine.unified_py_parameter_test.NetworkUnifiedPyParameterTest testMethod=testScalars>

    def testScalars(self):
      scalars = [
        ("int32Param", 32, int, 35),
        ("uint32Param", 33, int, 36),
        ("int64Param", 64, long, 74),
        ("uint64Param", 65, long, 75),
        ("real32Param", 32.1, float, 33.1),
        ("real64Param", 64.1, float, 65.1),
        ("stringParam", "nodespec value", str, "new value")]
    
      n = Network()
      l1= n.addRegion("l1", "TestNode", "")
      x = l1.getParameter("uint32Param")
    
      for paramName, initval, paramtype, newval in scalars:
        # Check the initial value for each parameter.
        x = l1.getParameter(paramName)
>       self.assertEqual(type(x), paramtype, paramName)
E       AssertionError: <type 'int'> != <type 'long'> : int64Param

Using git bisect I was able to pinpoint the issue to the the latest swig update.

This PR is reverting swig back to version 3.0.2 and adding a test similar to testScalars test to nupic.core so we could catch issues similar to this sooner.

@rhyolight Please review

@rhyolight
Copy link
Member

@breznak Luiz found that #1321 introduced a bug (perhaps in the new swig version, perhaps because of how we are using it). There is a test in NuPIC that found the bug. This PR moves the test here into nupic.core instead (where it should be), but the test fails as described above unless we revert back to swig 3.0.2.

Once this is merged, I will re-open #1293 and we can talk about what happened and how to get swig updated again if you like Marek.

@lscheinkman lscheinkman merged commit 51aadd1 into numenta:master Mar 21, 2018
@lscheinkman lscheinkman deleted the revert_swig_version branch April 4, 2018 20:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants