# Problem moving module RecordSensor

**URL:** <https://discourse.numenta.org/t/problem-moving-module-recordsensor/2309>\
**Category:** NuPIC\
**Tags:** refactoring\
**Created:** [May 12, 2017, 2:14pm UTC](https://discourse.numenta.org/t/problem-moving-module-recordsensor/2309 "2017-05-12T14:14:54Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rhyolight](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/rhyolight/32/3922_2.png) [@rhyolight](https://discourse.numenta.org/u/rhyolight)\
**Post date:** [May 12, 2017, 2:14pm UTC](https://discourse.numenta.org/t/problem-moving-module-recordsensor/2309/1 "2017-05-12T14:14:54Z")

</div>

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:

```auto
> 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?

---

<div class="post-metadata">

**Author:** ![scott](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/scott/32/170_2.png) [@scott](https://discourse.numenta.org/u/scott)\
**Post date:** [May 12, 2017, 5:57pm UTC](https://discourse.numenta.org/t/problem-moving-module-recordsensor/2309/2 "2017-05-12T17:57:40Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![rhyolight](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.numenta.org/rhyolight/32/3922_2.png) [@rhyolight](https://discourse.numenta.org/u/rhyolight)\
**Post date:** [May 12, 2017, 5:59pm UTC](https://discourse.numenta.org/t/problem-moving-module-recordsensor/2309/3 "2017-05-12T17:59:22Z")

</div>

Ok, in the meantime, I won’t do snake\_case refactoring in regions.
