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

Commit

Permalink
Move RecordSensor.py --> record_sensor.py
Browse files Browse the repository at this point in the history
  • Loading branch information
rhyolight committed May 22, 2017
1 parent 99856ea commit 61e18a6
Show file tree
Hide file tree
Showing 32 changed files with 35 additions and 35 deletions.
2 changes: 1 addition & 1 deletion docs/examples/network/complete-network-example.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def createNetwork(dataSource):
network = Network()

# Add a sensor region.
network.addRegion("sensor", "py.RecordSensor", '{}')
network.addRegion("sensor", "py.record_sensor", '{}')

# Set the encoder and data source of the sensor region.
sensorRegion = network.regions["sensor"].getSelf()
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/network/example-add-sensor-region.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
network.addRegion("sensor", "py.RecordSensor", '{}')
network.addRegion("sensor", "py.record_sensor", '{}')
2 changes: 1 addition & 1 deletion docs/examples/network/example-create-regions.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import json

# Add a sensor region, set its encoder and data source.
network.addRegion("sensor", "py.RecordSensor", json.dumps({"verbosity": 0}))
network.addRegion("sensor", "py.record_sensor", json.dumps({"verbosity": 0}))

# Make sure the SP input width matches the sensor region output width.
model_params["spParams"]["inputWidth"] = sensorRegion.encoder.getWidth()
Expand Down
2 changes: 1 addition & 1 deletion examples/network/custom_region_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def createNetwork(dataSource):
# Our input is sensor data from the gym file. The RecordSensor region
# allows us to specify a file record stream as the input source via the
# dataSource attribute.
network.addRegion("sensor", "py.RecordSensor",
network.addRegion("sensor", "py.record_sensor",
json.dumps({"verbosity": _VERBOSITY}))
sensor = network.regions["sensor"].getSelf()
# The RecordSensor needs to know how to encode the input values
Expand Down
2 changes: 1 addition & 1 deletion examples/network/hierarchy_network_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def createRecordSensor(network, name, dataSource):
"""

# Specific type of region. Possible options can be found in /nupic/regions/
regionType = "py.RecordSensor"
regionType = "py.record_sensor"

# Creates a json from specified dictionary.
regionParams = json.dumps({"verbosity": _VERBOSITY})
Expand Down
2 changes: 1 addition & 1 deletion examples/network/network_api_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def createNetwork(dataSource):
# Our input is sensor data from the gym file. The RecordSensor region
# allows us to specify a file record stream as the input source via the
# dataSource attribute.
network.addRegion("sensor", "py.RecordSensor",
network.addRegion("sensor", "py.record_sensor",
json.dumps({"verbosity": _VERBOSITY}))
sensor = network.regions["sensor"].getSelf()
# The RecordSensor needs to know how to encode the input values
Expand Down
2 changes: 1 addition & 1 deletion examples/network/temporal_anomaly_network_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def createTemporalAnomaly(recordParams, spatialParams=_SP_PARAMS,

network = Network()

network.addRegion("sensor", "py.RecordSensor",
network.addRegion("sensor", "py.record_sensor",
json.dumps({"verbosity": verbosity}))

sensor = network.regions["sensor"].getSelf()
Expand Down
2 changes: 1 addition & 1 deletion examples/opf/clients/cpu/model_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
# Sensor diagnostic output verbosity control;
# if > 0: sensor region will print out on screen what it's sensing
# at each step 0: silent; >=1: some info; >=2: more info;
# >=3: even more info (see compute() in py/regions/RecordSensor.py)
# >=3: even more info (see compute() in py/regions/record_sensor.py)
'verbosity' : 0,

# CPU usage encoder.
Expand Down
2 changes: 1 addition & 1 deletion examples/opf/clients/hotgym/anomaly/model_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
# Sensor diagnostic output verbosity control;
# if > 0: sensor region will print out on screen what it's sensing
# at each step 0: silent; >=1: some info; >=2: more info;
# >=3: even more info (see compute() in py/regions/RecordSensor.py)
# >=3: even more info (see compute() in py/regions/record_sensor.py)
'verbosity' : 0,

# Example:
Expand Down
2 changes: 1 addition & 1 deletion examples/opf/clients/hotgym/simple/model_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
# Sensor diagnostic output verbosity control;
# if > 0: sensor region will print out on screen what it's sensing
# at each step 0: silent; >=1: some info; >=2: more info;
# >=3: even more info (see compute() in py/regions/RecordSensor.py)
# >=3: even more info (see compute() in py/regions/record_sensor.py)
'verbosity' : 0,

# Include the encoders we use
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
# Sensor diagnostic output verbosity control;
# if > 0: sensor region will print out on screen what it's sensing
# at each step 0: silent; >=1: some info; >=2: more info;
# >=3: even more info (see compute() in py/regions/RecordSensor.py)
# >=3: even more info (see compute() in py/regions/record_sensor.py)
'verbosity' : 0,

# Example:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
# Sensor diagnostic output verbosity control;
# if > 0: sensor region will print out on screen what it's sensing
# at each step 0: silent; >=1: some info; >=2: more info;
# >=3: even more info (see compute() in py/regions/RecordSensor.py)
# >=3: even more info (see compute() in py/regions/record_sensor.py)
'verbosity' : 0,

# Example:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
# Sensor diagnostic output verbosity control;
# if > 0: sensor region will print out on screen what it's sensing
# at each step 0: silent; >=1: some info; >=2: more info;
# >=3: even more info (see compute() in py/regions/RecordSensor.py)
# >=3: even more info (see compute() in py/regions/record_sensor.py)
'verbosity' : 0,

# Example:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
# Sensor diagnostic output verbosity control;
# if > 0: sensor region will print out on screen what it's sensing
# at each step 0: silent; >=1: some info; >=2: more info;
# >=3: even more info (see compute() in py/regions/RecordSensor.py)
# >=3: even more info (see compute() in py/regions/record_sensor.py)
'verbosity' : 0,

# Example:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
# Sensor diagnostic output verbosity control;
# if > 0: sensor region will print out on screen what it's sensing
# at each step 0: silent; >=1: some info; >=2: more info;
# >=3: even more info (see compute() in py/regions/RecordSensor.py)
# >=3: even more info (see compute() in py/regions/record_sensor.py)
'verbosity' : 1,

# Example:
Expand Down
2 changes: 1 addition & 1 deletion src/nupic/data/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

from pkg_resources import resource_filename

from nupic.regions.RecordSensor import RecordSensor
from nupic.regions.record_sensor import RecordSensor
from nupic.data.file_record_stream import FileRecordStream


Expand Down
2 changes: 1 addition & 1 deletion src/nupic/engine/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
("nupic.regions.KNNClassifierRegion", "KNNClassifierRegion"),
("nupic.regions.PluggableEncoderSensor", "PluggableEncoderSensor"),
("nupic.regions.PyRegion", "PyRegion"),
("nupic.regions.RecordSensor", "RecordSensor"),
("nupic.regions.record_sensor", "record_sensor"),
("nupic.regions.SDRClassifierRegion", "SDRClassifierRegion"),
("nupic.regions.SPRegion", "SPRegion"),
("nupic.regions.SVMClassifierNode", "SVMClassifierNode"),
Expand Down
2 changes: 1 addition & 1 deletion src/nupic/frameworks/opf/htm_prediction_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1082,7 +1082,7 @@ def __createCLANetwork(self, sensorParams, spEnable, spParams, tmEnable,

#--------------------------------------------------
# Add the Sensor
n.addRegion("sensor", "py.RecordSensor", json.dumps(dict(verbosity=sensorParams['verbosity'])))
n.addRegion("sensor", "py.record_sensor", json.dumps(dict(verbosity=sensorParams['verbosity'])))
sensor = n.regions['sensor'].getSelf()

enabledEncoders = copy.deepcopy(sensorParams['encoders'])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class RecordSensor(PyRegion):
from nupic.data.file.file_record_stream import FileRecordStream
n = Network()
s = n.addRegion("sensor", "py.RecordSensor", "")
s = n.addRegion("sensor", "py.record_sensor", "")
mysource = FileRecordStream("mydata.txt")
myencoder = MultiEncoder()
... set up myencoder ...
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/nupic/engine/network_checkpoint_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import numpy

from nupic.regions.SPRegion import SPRegion
from nupic.regions.RecordSensor import RecordSensor
from nupic.regions.record_sensor import RecordSensor

from network_creation_common import createAndRunNetwork

Expand Down
4 changes: 2 additions & 2 deletions tests/integration/nupic/engine/network_creation_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from nupic.data.file_record_stream import FileRecordStream
from nupic.engine import Network
from nupic.encoders import MultiEncoder, ScalarEncoder, DateEncoder
from nupic.regions.RecordSensor import RecordSensor
from nupic.regions.record_sensor import RecordSensor
from nupic.regions.SPRegion import SPRegion
from nupic.regions.TMRegion import TMRegion

Expand Down Expand Up @@ -119,7 +119,7 @@ def createNetwork(dataSource, enableTP=False, temporalImp="py"):
# Our input is sensor data from the gym file. The RecordSensor region
# allows us to specify a file record stream as the input source via the
# dataSource attribute.
network.addRegion("sensor", "py.RecordSensor",
network.addRegion("sensor", "py.record_sensor",
json.dumps({"verbosity": _VERBOSITY}))
sensor = network.regions["sensor"].getSelf()
# The RecordSensor needs to know how to encode the input values
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Version: 2
Regions:
- name: sensor
nodeType: py.RecordSensor
nodeType: py.record_sensor
dimensions:
- 1
phases:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
# Sensor diagnostic output verbosity control;
# if > 0: sensor region will print out on screen what it's sensing
# at each step 0: silent; >=1: some info; >=2: more info;
# >=3: even more info (see compute() in py/regions/RecordSensor.py)
# >=3: even more info (see compute() in py/regions/record_sensor.py)
'verbosity' : VERBOSITY,

# Example:
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/nupic/opf/opf_region_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def _createOPFNetwork(addSP = True, addTP = False):
# ==========================================================================
# Now create the network itself
n = Network()
n.addRegion("sensor", "py.RecordSensor", json.dumps(sensorParams))
n.addRegion("sensor", "py.record_sensor", json.dumps(sensorParams))

sensor = n.regions['sensor'].getSelf()
sensor.encoder = encoder
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/nupic/regions/multiclass_knn_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def testSimpleMulticlassNetwork(self):

# Create the network and get region instances.
net = Network()
net.addRegion("sensor", "py.RecordSensor", "{'numCategories': 3}")
net.addRegion("sensor", "py.record_sensor", "{'numCategories': 3}")
net.addRegion("classifier","py.KNNClassifierRegion",
"{'k': 2,'distThreshold': 0,'maxCategoryCount': 3}")
net.link("sensor", "classifier", "UniformLink", "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def testSimpleMulticlassNetworkPY(self):

# Create the network and get region instances.
net = Network()
net.addRegion("sensor", "py.RecordSensor", "{'numCategories': 3}")
net.addRegion("sensor", "py.record_sensor", "{'numCategories': 3}")
net.addRegion("classifier", "py.SDRClassifierRegion",
"{steps: '0', alpha: 0.001, implementation: 'py'}")
net.link("sensor", "classifier", "UniformLink", "",
Expand Down Expand Up @@ -153,7 +153,7 @@ def testSimpleMulticlassNetworkCPP(self):

# Create the network and get region instances.
net = Network()
net.addRegion("sensor", "py.RecordSensor", "{'numCategories': 3}")
net.addRegion("sensor", "py.record_sensor", "{'numCategories': 3}")
net.addRegion("classifier", "py.SDRClassifierRegion",
"{steps: '0', alpha: 0.001, implementation: 'cpp'}")
net.link("sensor", "classifier", "UniformLink", "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
# Sensor diagnostic output verbosity control;
# if > 0: sensor region will print out on screen what it's sensing
# at each step 0: silent; >=1: some info; >=2: more info;
# >=3: even more info (see compute() in py/regions/RecordSensor.py)
# >=3: even more info (see compute() in py/regions/record_sensor.py)
'verbosity' : 0,

# Example:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
# Sensor diagnostic output verbosity control;
# if > 0: sensor region will print out on screen what it's sensing
# at each step 0: silent; >=1: some info; >=2: more info;
# >=3: even more info (see compute() in py/regions/RecordSensor.py)
# >=3: even more info (see compute() in py/regions/record_sensor.py)
'verbosity' : 0,

# Example:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
# Sensor diagnostic output verbosity control;
# if > 0: sensor region will print out on screen what it's sensing
# at each step 0: silent; >=1: some info; >=2: more info;
# >=3: even more info (see compute() in py/regions/RecordSensor.py)
# >=3: even more info (see compute() in py/regions/record_sensor.py)
'verbosity' : 0,

# Example:
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/nupic/data/filters_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import unittest2 as unittest
from pkg_resources import resource_filename

from nupic.regions.RecordSensor import RecordSensor
from nupic.regions.record_sensor import RecordSensor
from nupic.data.file_record_stream import FileRecordStream
from nupic.encoders import MultiEncoder
from nupic.data.filters import DeltaFilter
Expand Down
4 changes: 2 additions & 2 deletions tests/unit/nupic/regions/record_sensor_region_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
def _createNetwork():
"""Create network with one RecordSensor region."""
network = Network()
network.addRegion('sensor', 'py.RecordSensor', '{}')
network.addRegion('sensor', 'py.record_sensor', '{}')
sensorRegion = network.regions['sensor'].getSelf()

# Add an encoder.
Expand Down Expand Up @@ -69,7 +69,7 @@ def testVaryingNumberOfCategories(self):
# Setup network with sensor; max number of categories = 2
net = Network()
sensorRegion = net.addRegion(
"sensor", "py.RecordSensor", "{'numCategories': 2}")
"sensor", "py.record_sensor", "{'numCategories': 2}")
sensor = sensorRegion.getSelf()

# Test for # of output categories = max
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/nupic/regions/sdr_classifier_region_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def _createNetwork():
"""Create a network with a RecordSensor region and a SDRClassifier region"""

network = Network()
network.addRegion('sensor', 'py.RecordSensor', '{}')
network.addRegion('sensor', 'py.record_sensor', '{}')
network.addRegion('classifier', 'py.SDRClassifierRegion', '{}')
_createSensorToClassifierLinks(network, 'sensor', 'classifier')

Expand Down

0 comments on commit 61e18a6

Please sign in to comment.