Skip to content

Commit

Permalink
Snake case module names PART 2 (#3561)
Browse files Browse the repository at this point in the history
* Updating module names: expdescriptionapi, expdescriptionhelper, htmpredictionmodel

* Renamed modules:

    renamed:    src/nupic/frameworks/opf/htmpredictionmodelcallbacks.py
-> src/nupic/frameworks/opf/htm_prediction_model_callbacks.py
    renamed:
src/nupic/frameworks/opf/htmpredictionmodel_classifier_helper.py ->
src/nupic/frameworks/opf/htm_prediction_model_classifier_helper.py
    renamed:    src/nupic/frameworks/opf/modelcallbacks.py ->
src/nupic/frameworks/opf/model_callbacks.py
    renamed:    src/nupic/frameworks/opf/modelfactory.py ->
src/nupic/frameworks/opf/model_factory.py
    renamed:    src/nupic/frameworks/opf/opfbasicenvironment.py ->
src/nupic/frameworks/opf/opf_basic_environment.py
    renamed:    src/nupic/frameworks/opf/opfenvironment.py ->
src/nupic/frameworks/opf/opf_environment.py
    renamed:    src/nupic/frameworks/opf/opfhelpers.py ->
src/nupic/frameworks/opf/opf_helpers.py

* opftaskdriver => opf_task_driver

* renamed opfutils to opf_utils

    renamed:    src/nupic/frameworks/opf/opfutils.py ->
src/nupic/frameworks/opf/opf_utils.py

* Renaming modules:

renamed:    src/nupic/frameworks/opf/predictionmetricsmanager.py -> src/nupic/frameworks/opf/prediction_metrics_manager.py
renamed:    src/nupic/frameworks/opf/previousvaluemodel.py -> src/nupic/frameworks/opf/previous_value_model.py
  • Loading branch information
rhyolight authored Apr 28, 2017
1 parent 02eec46 commit 32a9492
Show file tree
Hide file tree
Showing 35 changed files with 54 additions and 55 deletions.
4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ nupic
│ │ │ ├── ModelResults [OK]
│ │ │ └── SensorInput [OK]
│   │   ├── periodic.py [TODO]
│   │   ├── predictionmetricsmanager.py [TODO]
│   │   ├── previousvaluemodel.py [TODO]
│   │   ├── prediction_metrics_manager.py [TODO]
│   │   ├── previous_value_model.py [TODO]
│   │   ├── safe_interpreter.py [TODO]
│   │   └── two_gram_model.py [TODO]
│   └── viz
Expand Down
2 changes: 1 addition & 1 deletion docs/source/api/opf/metrics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Metrics
MetricsManager
^^^^^^^^^^^^^^

.. autoclass:: nupic.frameworks.opf.predictionmetricsmanager.MetricsManager
.. autoclass:: nupic.frameworks.opf.prediction_metrics_manager.MetricsManager
:members:

MetricSpec
Expand Down
2 changes: 1 addition & 1 deletion examples/opf/clients/hotgym/prediction/one_gym/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from nupic.data.inference_shifter import InferenceShifter
from nupic.frameworks.opf.metrics import MetricSpec
from nupic.frameworks.opf.model_factory import ModelFactory
from nupic.frameworks.opf.predictionmetricsmanager import MetricsManager
from nupic.frameworks.opf.prediction_metrics_manager import MetricsManager

import nupic_output

Expand Down
2 changes: 1 addition & 1 deletion examples/opf/clients/hotgym/simple/hotgym.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

from nupic.frameworks.opf.metrics import MetricSpec
from nupic.frameworks.opf.model_factory import ModelFactory
from nupic.frameworks.opf.predictionmetricsmanager import MetricsManager
from nupic.frameworks.opf.prediction_metrics_manager import MetricsManager

import model_params

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
applyValueGettersToContainer,
DeferredDictLookup)

from nupic.frameworks.opf.predictionmetricsmanager import MetricSpec
from nupic.frameworks.opf.prediction_metrics_manager import MetricSpec

from nupic.frameworks.opf.opf_task_driver import (
IterationPhaseSpecLearnOnly,
Expand Down
2 changes: 1 addition & 1 deletion src/nupic/data/aggregator.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import time

from nupic.data import SENTINEL_VALUE_FOR_MISSING_DATA
from nupic.data.fieldmeta import FieldMetaSpecial
from nupic.data.field_meta import FieldMetaSpecial
from nupic.data.file_record_stream import FileRecordStream


Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/nupic/data/file_record_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
import copy
import json

from nupic.data.fieldmeta import FieldMetaInfo, FieldMetaType, FieldMetaSpecial
from nupic.data.field_meta import FieldMetaInfo, FieldMetaType, FieldMetaSpecial
from nupic.data import SENTINEL_VALUE_FOR_MISSING_DATA
from nupic.data.record_stream import RecordStreamIface
from nupic.data.utils import (intOrNone, floatOrNone, parseBool, parseTimestamp,
Expand Down
2 changes: 1 addition & 1 deletion src/nupic/data/record_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import datetime


from nupic.data.fieldmeta import FieldMetaSpecial
from nupic.data.field_meta import FieldMetaSpecial



Expand Down
2 changes: 1 addition & 1 deletion src/nupic/data/stream_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import pkg_resources

from nupic.data.aggregator import Aggregator
from nupic.data.fieldmeta import FieldMetaInfo, FieldMetaType, FieldMetaSpecial
from nupic.data.field_meta import FieldMetaInfo, FieldMetaType, FieldMetaSpecial
from nupic.data.file_record_stream import FileRecordStream
from nupic.data import jsonhelpers
from nupic.data.record_stream import RecordStreamIface
Expand Down
2 changes: 1 addition & 1 deletion src/nupic/encoders/category.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

import numpy

from nupic.data.fieldmeta import FieldMetaType
from nupic.data.field_meta import FieldMetaType
from nupic.data import SENTINEL_VALUE_FOR_MISSING_DATA
from nupic.encoders.base import Encoder, EncoderResult
from nupic.encoders.scalar import ScalarEncoder
Expand Down
2 changes: 1 addition & 1 deletion src/nupic/encoders/logenc.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

import numpy
from nupic.data import SENTINEL_VALUE_FOR_MISSING_DATA
from nupic.data.fieldmeta import FieldMetaType
from nupic.data.field_meta import FieldMetaType
from nupic.encoders.base import Encoder, EncoderResult
from nupic.encoders.scalar import ScalarEncoder

Expand Down
2 changes: 1 addition & 1 deletion src/nupic/encoders/pass_through_encoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# ----------------------------------------------------------------------

import numpy
from nupic.data.fieldmeta import FieldMetaType
from nupic.data.field_meta import FieldMetaType
from nupic.encoders.base import Encoder


Expand Down
2 changes: 1 addition & 1 deletion src/nupic/encoders/random_distributed_scalar.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import numpy

from nupic.data import SENTINEL_VALUE_FOR_MISSING_DATA
from nupic.data.fieldmeta import FieldMetaType
from nupic.data.field_meta import FieldMetaType
from nupic.encoders.base import Encoder
from nupic.bindings.math import Random as NupicRandom

Expand Down
2 changes: 1 addition & 1 deletion src/nupic/encoders/scalar.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import numpy

from nupic.data import SENTINEL_VALUE_FOR_MISSING_DATA
from nupic.data.fieldmeta import FieldMetaType
from nupic.data.field_meta import FieldMetaType
from nupic.bindings.math import SM32, GetNTAReal
from nupic.encoders.base import Encoder, EncoderResult

Expand Down
2 changes: 1 addition & 1 deletion src/nupic/encoders/sdrcategory.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import random

import numpy
from nupic.data.fieldmeta import FieldMetaType
from nupic.data.field_meta import FieldMetaType
from nupic.data import SENTINEL_VALUE_FOR_MISSING_DATA
from nupic.encoders.base import Encoder, EncoderResult
from nupic.bindings.math import SM32, GetNTAReal, Random as NupicRandom
Expand Down
2 changes: 1 addition & 1 deletion src/nupic/frameworks/opf/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

from nupic.frameworks.opf.model_factory import ModelFactory
from nupic.frameworks.opf.opf_basic_environment import BasicDatasetReader
from nupic.frameworks.opf.predictionmetricsmanager import MetricsManager
from nupic.frameworks.opf.prediction_metrics_manager import MetricsManager


class Client(object):
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 @@ -39,7 +39,7 @@

from nupic.frameworks.opf.model import Model
from nupic.data import SENTINEL_VALUE_FOR_MISSING_DATA
from nupic.data.fieldmeta import FieldMetaSpecial, FieldMetaInfo
from nupic.data.field_meta import FieldMetaSpecial, FieldMetaInfo
from nupic.encoders import MultiEncoder, DeltaEncoder
from nupic.engine import Network
from nupic.support.fshelpers import makeDirectoryFromAbsolutePath
Expand Down
2 changes: 1 addition & 1 deletion src/nupic/frameworks/opf/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import random
import numpy as np

from nupic.data.fieldmeta import FieldMetaType
from nupic.data.field_meta import FieldMetaType
import nupic.math.roc_utils as roc
from nupic.data import SENTINEL_VALUE_FOR_MISSING_DATA
from nupic.frameworks.opf.opf_utils import InferenceType
Expand Down
2 changes: 1 addition & 1 deletion src/nupic/frameworks/opf/model_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
from htm_prediction_model import HTMPredictionModel
from model import Model
from two_gram_model import TwoGramModel
from previousvaluemodel import PreviousValueModel
from previous_value_model import PreviousValueModel

class ModelFactory(object):
""" Static factory class that produces a Model based on a description dict.
Expand Down
16 changes: 8 additions & 8 deletions src/nupic/frameworks/opf/opf_basic_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@
import opf_environment as opfenv
from nupic.data.file_record_stream import FileRecordStream
from nupic.data.stream_reader import StreamReader
from nupic.data.fieldmeta import (FieldMetaInfo,
FieldMetaType,
FieldMetaSpecial)
from nupic.data.field_meta import (FieldMetaInfo,
FieldMetaType,
FieldMetaSpecial)
from nupic.data.inference_shifter import InferenceShifter
from opf_utils import InferenceType, InferenceElement

Expand All @@ -66,7 +66,7 @@ class PredictionMetricsLoggerIface(object):
def emitPeriodicMetrics(self, metrics):
""" Emits periodic metrics
metrics: A list of predictionmetricsmanager.MetricValueElement:
metrics: A list of prediction_metrics_manager.MetricValueElement:
Returns: nothing.
"""
Expand All @@ -79,7 +79,7 @@ def emitFinalMetrics(self, metrics):
NOTE: the intention is that the final metrics may go to a different
place (e.g., csv file) versus emitPeriodicMetrics (e.g., stdout)
metrics: A list of predictionmetricsmanager.MetricValueElement:
metrics: A list of prediction_metrics_manager.MetricValueElement:
Returns: nothing.
"""
Expand Down Expand Up @@ -146,7 +146,7 @@ def append(self, inputRow, predictionRow, sequenceReset, metrics=None):
metrics: OPTIONAL -A dictionary of metrics that will be written out
with every prediction. The keys are the automatically
generated metric labels (see MetricSpec in
predictionmetricsmanager.py), and the value is the real
prediction_metrics_manager.py), and the value is the real
number value of the metric.
"""

Expand Down Expand Up @@ -194,7 +194,7 @@ def __repr__(self):
def emitPeriodicMetrics(self, metrics):
""" Emits periodic metrics
metrics: A list of predictionmetricsmanager.MetricValueElement:
metrics: A list of prediction_metrics_manager.MetricValueElement:
Returns: nothing.
"""
Expand All @@ -211,7 +211,7 @@ def emitFinalMetrics(self, metrics):
NOTE: the intention is that the final metrics may go to a different
place (e.g., csv file) versus emitPeriodicMetrics (e.g., stdout)
metrics: A list of predictionmetricsmanager.MetricValueElement:
metrics: A list of prediction_metrics_manager.MetricValueElement:
Returns: nothing.
"""
Expand Down
2 changes: 1 addition & 1 deletion src/nupic/frameworks/opf/opf_task_driver.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
import itertools
import logging

from predictionmetricsmanager import (
from prediction_metrics_manager import (
MetricsManager,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ def test():

def _testMetricsMgr():
print "*Testing Metrics Managers*..."
from nupic.data.fieldmeta import (
from nupic.data.field_meta import (
FieldMetaInfo,
FieldMetaType,
FieldMetaSpecial)
Expand Down Expand Up @@ -409,7 +409,7 @@ def _testTemporalShift():
prediction cases
"""
print "*Testing Multistep temporal shift*..."
from nupic.data.fieldmeta import (
from nupic.data.field_meta import (
FieldMetaInfo,
FieldMetaType,
FieldMetaSpecial)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

import itertools

from nupic.data import fieldmeta
from nupic.data import field_meta
from nupic.frameworks.opf import model
from nupic.frameworks.opf import opf_utils
from opf_utils import InferenceType
Expand Down Expand Up @@ -120,10 +120,10 @@ def getFieldInfo(self):
to the transcoding of some input fields into meta- fields, such as
datetime -> dayOfWeek, timeOfDay, etc.
"""
return tuple(fieldmeta.FieldMetaInfo(*args) for args in
return tuple(field_meta.FieldMetaInfo(*args) for args in
itertools.izip(
self._fieldNames, self._fieldTypes,
itertools.repeat(fieldmeta.FieldMetaSpecial.none)))
itertools.repeat(field_meta.FieldMetaSpecial.none)))

def getRuntimeStats(self):
"""Get the runtime statistics specific to the model.
Expand Down
6 changes: 3 additions & 3 deletions src/nupic/frameworks/opf/two_gram_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import itertools

from nupic import encoders
from nupic.data import fieldmeta
from nupic.data import field_meta
from nupic.frameworks.opf import model
from nupic.frameworks.opf import opf_utils
from opf_utils import InferenceType
Expand Down Expand Up @@ -146,10 +146,10 @@ def getFieldInfo(self):
fieldTypes = self._encoder.getDecoderOutputFieldTypes()
assert len(self._fieldNames) == len(fieldTypes)

return tuple(fieldmeta.FieldMetaInfo(*args) for args in
return tuple(field_meta.FieldMetaInfo(*args) for args in
itertools.izip(
self._fieldNames, fieldTypes,
itertools.repeat(fieldmeta.FieldMetaSpecial.none)))
itertools.repeat(field_meta.FieldMetaSpecial.none)))

def getRuntimeStats(self):
"""Get the runtime statistics specific to the model.
Expand Down
13 changes: 6 additions & 7 deletions src/nupic/regions/RecordSensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# ----------------------------------------------------------------------
import numpy
from nupic.bindings.regions.PyRegion import PyRegion
from nupic.data.fieldmeta import FieldMetaType
from nupic.data.field_meta import FieldMetaType
from nupic.encoders.multi import MultiEncoder

try:
Expand Down Expand Up @@ -56,7 +56,7 @@ class RecordSensor(PyRegion):
correspond to entries in the dictionary or attributes of the object. For
example, a DataSource might return:
dict(date="02-01-2010 23:12:23", amount=4.95, country="US",
dict(date="02-01-2010 23:12:23", amount=4.95, country="US",
_reset=0, _sequenceId=0)
or an object with attributes "date", "amount" and "country".
Expand Down Expand Up @@ -325,7 +325,7 @@ def applyFilters(self, data):
@param data: The data that will be processed by the filter.
@type data: dict
@return: a tuple with the data processed by the filter and a boolean to
@return: a tuple with the data processed by the filter and a boolean to
know whether or not the filter needs mode data.
"""

Expand All @@ -339,7 +339,7 @@ def applyFilters(self, data):
for f in self.preEncodingFilters:
# if filter needs more data, it returns False
filterHasEnoughData = f.process(data)
allFiltersHaveEnoughData = (allFiltersHaveEnoughData
allFiltersHaveEnoughData = (allFiltersHaveEnoughData
and filterHasEnoughData)
actualReset = actualReset or data['_reset']
data['_reset'] = originalReset
Expand Down Expand Up @@ -509,8 +509,8 @@ def _convertNonNumericData(self, spatialOutput, temporalOutput, output):
@param spatialOutput: The results of topDownCompute() for the spatial input.
@param temporalOutput: The results of topDownCompute() for the temporal
input.
@param output: The main dictionary of outputs passed to compute(). It is
expected to have keys 'spatialTopDownOut' and 'temporalTopDownOut' that
@param output: The main dictionary of outputs passed to compute(). It is
expected to have keys 'spatialTopDownOut' and 'temporalTopDownOut' that
are mapped to numpy arrays.
"""
encoders = self.encoder.getEncoderList()
Expand Down Expand Up @@ -635,4 +635,3 @@ def readFromProto(cls, proto):
instance.numCategories = proto.numCategories

return instance

2 changes: 1 addition & 1 deletion src/nupic/swarming/ModelRunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
from nupic.frameworks.opf.opf_utils import matchPatterns
from nupic.frameworks.opf.periodic import (PeriodicActivityMgr,
PeriodicActivityRequest)
from nupic.frameworks.opf.predictionmetricsmanager import MetricsManager
from nupic.frameworks.opf.prediction_metrics_manager import MetricsManager
from nupic.support.configuration import Configuration
from nupic.swarming.experimentutils import InferenceElement
from nupic.swarming import utils
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
# http://numenta.org/licenses/
# ----------------------------------------------------------------------

"""This file invokes predictionmetricsmanager.py tests
"""This file invokes prediction_metrics_manager.py tests
TODO: Move these tests to unit test format.
"""

from nupic.frameworks.opf.predictionmetricsmanager import (
from nupic.frameworks.opf.prediction_metrics_manager import (
test as predictionMetricsManagerTest)


Expand Down
2 changes: 1 addition & 1 deletion tests/unit/nupic/data/fieldmeta_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

import unittest2 as unittest

from nupic.data.fieldmeta import FieldMetaInfo, FieldMetaType, FieldMetaSpecial
from nupic.data.field_meta import FieldMetaInfo, FieldMetaType, FieldMetaSpecial



Expand Down
2 changes: 1 addition & 1 deletion tests/unit/nupic/data/file_record_stream_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

from datetime import datetime
from nupic.data import SENTINEL_VALUE_FOR_MISSING_DATA
from nupic.data.fieldmeta import FieldMetaInfo, FieldMetaType, FieldMetaSpecial
from nupic.data.field_meta import FieldMetaInfo, FieldMetaType, FieldMetaSpecial
from nupic.data.file_record_stream import FileRecordStream
from nupic.data.utils import (
parseTimestamp, serializeTimestamp, escape, unescape)
Expand Down
Loading

0 comments on commit 32a9492

Please sign in to comment.