Problem moving module RecordSensor

I’m trying to rename some regions, specificially:

renamed:    src/nupic/regions/RecordSensor.py -> src/nupic/regions/record_sensor.py

But I get this error now when I run a test:

> python tests/unit/nupic/docs/examples_test.py
WARN:   PyRegion::createSpec failed: 0x7fff5168b9d8
E
======================================================================
ERROR: setUpClass (__main__.ExamplesTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests/unit/nupic/docs/examples_test.py", line 80, in setUpClass
    for prediction in predictionGenerator(MAX_PREDICTIONS):
  File "/Users/mtaylor/nta/nupic/tests/unit/nupic/docs/../../../../docs/examples/opf/complete-opf-example.py", line 24, in runHotgym
    model = createModel()
  File "/Users/mtaylor/nta/nupic/tests/unit/nupic/docs/../../../../docs/examples/opf/complete-opf-example.py", line 19, in createModel
    return ModelFactory.create(modelParams)
  File "/Users/mtaylor/nta/nupic/src/nupic/frameworks/opf/model_factory.py", line 85, in create
    return modelClass(**modelConfig['modelParams'])
  File "/Users/mtaylor/nta/nupic/src/nupic/frameworks/opf/htm_prediction_model.py", line 229, in __init__
    clParams, anomalyParams)
  File "/Users/mtaylor/nta/nupic/src/nupic/frameworks/opf/htm_prediction_model.py", line 1085, in __createCLANetwork
    n.addRegion("sensor", "py.RecordSensor", json.dumps(dict(verbosity=sensorParams['verbosity'])))
  File "/Users/mtaylor/nta/nupic/src/nupic/engine/__init__.py", line 641, in addRegion
    engine_internal.Network.addRegion(self, name, nodeType, nodeParams)
  File "/Users/mtaylor/nta/nupic.core/bindings/py/src/nupic/bindings/engine_internal.py", line 1167, in addRegion
    return _engine_internal.Network_addRegion(self, *args, **kwargs)
ImportError: No module named RecordSensor

----------------------------------------------------------------------
Ran 0 tests in 0.435s

FAILED (errors=1)

So what exactly happens when this is called?

n.addRegion("sensor", "py.RecordSensor", json.dumps(dict(verbosity=sensorParams['verbosity'])))

If I change py.RecordSensor to py.record_sensor, I get a different error:

RuntimeError: Matching Python module for record_sensor not found.

@scott Are there nupic.core changes that need to be made in order to change region module names?

The region registration in the network api currently requires the module and class names to match. I’d like to remove that limitation soon.

Ok, in the meantime, I won’t do snake_case refactoring in regions.