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

Snake case module names PART 1 #3550

Merged
merged 6 commits into from
Apr 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,19 +84,19 @@ nupic
│   │   ├── common_models
│   │   │   └── cluster_params.py [TODO]
│   │   ├── exceptions.py [TODO]
│   │   ├── expdescriptionapi.py [TODO]
│   │   ├── expdescriptionhelpers.py [TODO]
│   │   ├── exp_description_api.py [TODO]
│   │   ├── exp_description_helpers.py [TODO]
│   │   ├── experiment_runner.py [TODO]
│   │   ├── jsonschema
│   │   ├── metrics.py [TODO]
│   │   ├── model.py [TODO]
│   │   ├── modelcallbacks.py [TODO]
│   │   ├── modelfactory.py [TODO]
│   │   ├── opfbasicenvironment.py [TODO]
│   │   ├── opfenvironment.py [TODO]
│   │   ├── opfhelpers.py [TODO]
│   │   ├── opftaskdriver.py [TODO]
│   │   ├── opfutils.py [TODO]
│   │   ├── model_callbacks.py [TODO]
│   │   ├── model_factory.py [TODO]
│   │   ├── opf_basic_environment.py [TODO]
│   │   ├── opf_environment.py [TODO]
│   │   ├── opf_helpers.py [TODO]
│   │   ├── opf_task_driver.py [TODO]
│   │   ├── opf_utils.py [TODO]
│ │ │ ├── ModelResults [OK]
│ │ │ └── SensorInput [OK]
│   │   ├── periodic.py [TODO]
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/opf/complete-example.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import yaml
from itertools import islice

from nupic.frameworks.opf.modelfactory import ModelFactory
from nupic.frameworks.opf.model_factory import ModelFactory

_NUM_RECORDS = 3000
_EXAMPLE_DIR = os.path.dirname(os.path.abspath(__file__))
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/opf/create-model-example.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import yaml
from nupic.frameworks.opf.modelfactory import ModelFactory
from nupic.frameworks.opf.model_factory import ModelFactory

_PARAMS_PATH = "/path/to/model.yaml"

Expand Down
4 changes: 2 additions & 2 deletions docs/source/api/opf/models.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Model
HTMPredictionModel
^^^^^^^^

.. autoclass:: nupic.frameworks.opf.htmpredictionmodel.HTMPredictionModel
.. autoclass:: nupic.frameworks.opf.htm_prediction_model.HTMPredictionModel
:members:
:show-inheritance:
=======
Expand All @@ -26,5 +26,5 @@ TwoGramModel
ModelFactory
^^^^^^^^^^^^

.. autoclass:: nupic.frameworks.opf.modelfactory.ModelFactory
.. autoclass:: nupic.frameworks.opf.model_factory.ModelFactory
:members:
2 changes: 1 addition & 1 deletion docs/source/api/opf/utils.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ Common Models
Helpers
^^^^^^^

.. automodule:: nupic.frameworks.opf.opfhelpers
.. automodule:: nupic.frameworks.opf.opf_helpers
:members:
2 changes: 1 addition & 1 deletion docs/source/guides/opf.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ binary numpy arrays, one for each field in dataRow.

The concept of InferenceElements is a key part of the OPF. A model's inference may have multiple parts to it. For example, a model may output both a prediction and an anomaly score. Models output their set of inferences as a dictionary that is keyed by the enumerated type InferenceElement. Each entry in an inference dictionary is considered a separate inference element, and is handled independently by the OPF.

Data structures related to inference elements are located in [**opfutils.py**](https://github.com/numenta/nupic/blob/master/nupic/frameworks/opf/opfutils.py).
Data structures related to inference elements are located in [**opf_utils.py**](https://github.com/numenta/nupic/blob/master/nupic/frameworks/opf/opf_utils.py).

#### Inference Data Types

Expand Down
2 changes: 1 addition & 1 deletion docs/source/guides/swarming/running.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ In addition to the information printed to stdout, run_swarm also generates the f
* **permutations.py**: This is a swarming permutations file that defines the extent of the search space used during the swarm. For example, it includes the min and max allowed value for each parameter. Unless you want to perform a more advanced swarm (see below), you can ignore this file.
* **model_0/description.py**: This is an OPF description file which overrides specific parameters from the above description.py with the best values found during the swarming process. This description file can be run using run_opf_experiment.py.
* **model_0/params.csv**: A csv file containing the parameter values chosen for this best model. This is for reference only.
* **model_0/model_params.py**: The model parameters, which can be used for creating models manually through the [`ModelFactory`](https://github.com/numenta/nupic/blob/master/py/nupic/frameworks/opf/modelfactory.py#L33).
* **model_0/model_params.py**: The model parameters, which can be used for creating models manually through the [`ModelFactory`](https://github.com/numenta/nupic/blob/master/py/nupic/frameworks/opf/model_factory.py#L33).
* **search_def_Report.csv**: This is a spreadsheet that lists information on each of the models that were evaluated as part of the swarm. For each model, it has the parameters that were used and the results that that model generated on each of the error metrics that were evaluated.

**Note:** when running the swarm, if you get an error such as "No handlers could be found for logger..." it could be a MySQL setup issue. You can check this using the [above script](#prerequisites).
Expand Down
6 changes: 3 additions & 3 deletions examples/NuPIC Walkthrough.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -1252,7 +1252,7 @@
},
"outputs": [],
"source": [
"from nupic.frameworks.opf.modelfactory import ModelFactory\n",
"from nupic.frameworks.opf.model_factory import ModelFactory\n",
"model = ModelFactory.create(MODEL_PARAMS)\n",
"model.enableInference({'predictedField': 'consumption'})"
]
Expand Down Expand Up @@ -1759,7 +1759,7 @@
},
"outputs": [],
"source": [
"from nupic.frameworks.opf.modelfactory import ModelFactory\n",
"from nupic.frameworks.opf.model_factory import ModelFactory\n",
"model = ModelFactory.create(MODEL_PARAMS)\n",
"model.enableInference({'predictedField': 'consumption'})"
]
Expand Down Expand Up @@ -1903,4 +1903,4 @@
},
"nbformat": 4,
"nbformat_minor": 0
}
}
6 changes: 3 additions & 3 deletions examples/opf/clients/cpu/cpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import matplotlib.pyplot as plt

from nupic.data.inference_shifter import InferenceShifter
from nupic.frameworks.opf.modelfactory import ModelFactory
from nupic.frameworks.opf.model_factory import ModelFactory

import model_params

Expand Down Expand Up @@ -81,10 +81,10 @@ def runCPU():
actline.set_ydata(actHistory) # update the data
predline.set_ydata(predHistory) # update the data
plt.draw()
plt.legend( ('actual','predicted') )
plt.legend( ('actual','predicted') )

# Make sure we wait a total of 2 seconds per iteration.
try:
try:
plt.pause(SECONDS_PER_STEP)
except:
pass
Expand Down
2 changes: 1 addition & 1 deletion examples/opf/clients/hotgym/anomaly/hotgym_anomaly.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

from pkg_resources import resource_filename

from nupic.frameworks.opf.modelfactory import ModelFactory
from nupic.frameworks.opf.model_factory import ModelFactory

import model_params

Expand Down
2 changes: 1 addition & 1 deletion examples/opf/clients/hotgym/anomaly/one_gym/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import datetime

from nupic.data.inference_shifter import InferenceShifter
from nupic.frameworks.opf.modelfactory import ModelFactory
from nupic.frameworks.opf.model_factory import ModelFactory

import nupic_anomaly_output

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 @@ -29,7 +29,7 @@

from nupic.data.inference_shifter import InferenceShifter
from nupic.frameworks.opf.metrics import MetricSpec
from nupic.frameworks.opf.modelfactory import ModelFactory
from nupic.frameworks.opf.model_factory import ModelFactory
from nupic.frameworks.opf.predictionmetricsmanager 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 @@ -28,7 +28,7 @@
from pkg_resources import resource_filename

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

import model_params
Expand Down
2 changes: 1 addition & 1 deletion examples/opf/clients/nyctaxi/nyctaxi_anomaly.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

from pkg_resources import resource_filename

from nupic.frameworks.opf.modelfactory import ModelFactory
from nupic.frameworks.opf.model_factory import ModelFactory

import model_params

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@
'~/nupic/eng/lib/python2.6/site-packages/nupic/frameworks/opf/expGenerator/ExpGenerator.py'
"""

from nupic.frameworks.opf.expdescriptionapi import ExperimentDescriptionAPI
from nupic.frameworks.opf.exp_description_api import ExperimentDescriptionAPI

from nupic.frameworks.opf.expdescriptionhelpers import (
from nupic.frameworks.opf.exp_description_helpers import (
updateConfigFromSubConfig,
applyValueGettersToContainer,
DeferredDictLookup)

from nupic.frameworks.opf.htmpredictionmodelcallbacks import *
from nupic.frameworks.opf.htm_prediction_model_callbacks import *
from nupic.frameworks.opf.metrics import MetricSpec
from nupic.frameworks.opf.opfutils import (InferenceType,
InferenceElement)
from nupic.frameworks.opf.opf_utils import (InferenceType,
InferenceElement)
from nupic.support import aggregationDivide

from nupic.frameworks.opf.opftaskdriver import (
from nupic.frameworks.opf.opf_task_driver import (
IterationPhaseSpecLearnOnly,
IterationPhaseSpecInferOnly,
IterationPhaseSpecLearnAndInfer)
Expand Down Expand Up @@ -379,7 +379,7 @@
# Task Control parameters for OPFTaskDriver (per opfTaskControlSchema.json)
'taskControl' : {

# Iteration cycle list consisting of opftaskdriver.IterationPhaseSpecXXXXX
# Iteration cycle list consisting of opf_task_driver.IterationPhaseSpecXXXXX
# instances.
'iterationCycle' : [
#IterationPhaseSpecLearnOnly(1000),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@
'~/nupic/eng/lib/python2.6/site-packages/nupic/frameworks/opf/expGenerator/ExpGenerator.py'
"""

from nupic.frameworks.opf.expdescriptionapi import ExperimentDescriptionAPI
from nupic.frameworks.opf.exp_description_api import ExperimentDescriptionAPI

from nupic.frameworks.opf.expdescriptionhelpers import (
from nupic.frameworks.opf.exp_description_helpers import (
updateConfigFromSubConfig,
applyValueGettersToContainer,
DeferredDictLookup)

from nupic.frameworks.opf.htmpredictionmodelcallbacks import *
from nupic.frameworks.opf.htm_prediction_model_callbacks import *
from nupic.frameworks.opf.metrics import MetricSpec
from nupic.frameworks.opf.opfutils import (InferenceType,
InferenceElement)
from nupic.frameworks.opf.opf_utils import (InferenceType,
InferenceElement)
from nupic.support import aggregationDivide

from nupic.frameworks.opf.opftaskdriver import (
from nupic.frameworks.opf.opf_task_driver import (
IterationPhaseSpecLearnOnly,
IterationPhaseSpecInferOnly,
IterationPhaseSpecLearnAndInfer)
Expand Down Expand Up @@ -379,7 +379,7 @@
# Task Control parameters for OPFTaskDriver (per opfTaskControlSchema.json)
'taskControl' : {

# Iteration cycle list consisting of opftaskdriver.IterationPhaseSpecXXXXX
# Iteration cycle list consisting of opf_task_driver.IterationPhaseSpecXXXXX
# instances.
'iterationCycle' : [
#IterationPhaseSpecLearnOnly(1000),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@
'~/nupic/eng/lib/python2.6/site-packages/nupic/frameworks/opf/expGenerator/ExpGenerator.py'
"""

from nupic.frameworks.opf.expdescriptionapi import ExperimentDescriptionAPI
from nupic.frameworks.opf.exp_description_api import ExperimentDescriptionAPI

from nupic.frameworks.opf.expdescriptionhelpers import (
from nupic.frameworks.opf.exp_description_helpers import (
updateConfigFromSubConfig,
applyValueGettersToContainer,
DeferredDictLookup)

from nupic.frameworks.opf.htmpredictionmodelcallbacks import *
from nupic.frameworks.opf.htm_prediction_model_callbacks import *
from nupic.frameworks.opf.metrics import MetricSpec
from nupic.frameworks.opf.opfutils import (InferenceType,
InferenceElement)
from nupic.frameworks.opf.opf_utils import (InferenceType,
InferenceElement)
from nupic.support import aggregationDivide

from nupic.frameworks.opf.opftaskdriver import (
from nupic.frameworks.opf.opf_task_driver import (
IterationPhaseSpecLearnOnly,
IterationPhaseSpecInferOnly,
IterationPhaseSpecLearnAndInfer)
Expand Down Expand Up @@ -370,7 +370,7 @@
# Task Control parameters for OPFTaskDriver (per opfTaskControlSchema.json)
'taskControl' : {

# Iteration cycle list consisting of opftaskdriver.IterationPhaseSpecXXXXX
# Iteration cycle list consisting of opf_task_driver.IterationPhaseSpecXXXXX
# instances.
'iterationCycle' : [
#IterationPhaseSpecLearnOnly(1000),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@
'~/nupic/eng/lib/python2.6/site-packages/nupic/frameworks/opf/expGenerator/ExpGenerator.py'
"""

from nupic.frameworks.opf.expdescriptionapi import ExperimentDescriptionAPI
from nupic.frameworks.opf.exp_description_api import ExperimentDescriptionAPI

from nupic.frameworks.opf.expdescriptionhelpers import (
from nupic.frameworks.opf.exp_description_helpers import (
updateConfigFromSubConfig,
applyValueGettersToContainer,
DeferredDictLookup)

from nupic.frameworks.opf.htmpredictionmodelcallbacks import *
from nupic.frameworks.opf.htm_prediction_model_callbacks import *
from nupic.frameworks.opf.metrics import MetricSpec
from nupic.frameworks.opf.opfutils import (InferenceType,
InferenceElement)
from nupic.frameworks.opf.opf_utils import (InferenceType,
InferenceElement)
from nupic.support import aggregationDivide

from nupic.frameworks.opf.opftaskdriver import (
from nupic.frameworks.opf.opf_task_driver import (
IterationPhaseSpecLearnOnly,
IterationPhaseSpecInferOnly,
IterationPhaseSpecLearnAndInfer)
Expand Down Expand Up @@ -370,7 +370,7 @@
# Task Control parameters for OPFTaskDriver (per opfTaskControlSchema.json)
'taskControl' : {

# Iteration cycle list consisting of opftaskdriver.IterationPhaseSpecXXXXX
# Iteration cycle list consisting of opf_task_driver.IterationPhaseSpecXXXXX
# instances.
'iterationCycle' : [
#IterationPhaseSpecLearnOnly(1000),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@
'~/nupic/eng/lib/python2.6/site-packages/nupic/frameworks/opf/expGenerator/ExpGenerator.py'
"""

from nupic.frameworks.opf.expdescriptionapi import ExperimentDescriptionAPI
from nupic.frameworks.opf.exp_description_api import ExperimentDescriptionAPI

from nupic.frameworks.opf.expdescriptionhelpers import (
from nupic.frameworks.opf.exp_description_helpers import (
updateConfigFromSubConfig,
applyValueGettersToContainer,
DeferredDictLookup)

from nupic.frameworks.opf.htmpredictionmodelcallbacks import *
from nupic.frameworks.opf.htm_prediction_model_callbacks import *
from nupic.frameworks.opf.metrics import MetricSpec
from nupic.frameworks.opf.opfutils import (InferenceType,
InferenceElement)
from nupic.frameworks.opf.opf_utils import (InferenceType,
InferenceElement)
from nupic.support import aggregationDivide

from nupic.frameworks.opf.opftaskdriver import (
from nupic.frameworks.opf.opf_task_driver import (
IterationPhaseSpecLearnOnly,
IterationPhaseSpecInferOnly,
IterationPhaseSpecLearnAndInfer)
Expand Down Expand Up @@ -370,7 +370,7 @@
# Task Control parameters for OPFTaskDriver (per opfTaskControlSchema.json)
'taskControl' : {

# Iteration cycle list consisting of opftaskdriver.IterationPhaseSpecXXXXX
# Iteration cycle list consisting of opf_task_driver.IterationPhaseSpecXXXXX
# instances.
'iterationCycle' : [
#IterationPhaseSpecLearnOnly(1000),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,20 @@
'~/nupic/eng/lib/python2.6/site-packages/nupic/frameworks/opf/expGenerator/ExpGenerator.py'
"""

from nupic.frameworks.opf.expdescriptionapi import ExperimentDescriptionAPI
from nupic.frameworks.opf.exp_description_api import ExperimentDescriptionAPI

from nupic.frameworks.opf.expdescriptionhelpers import (
from nupic.frameworks.opf.exp_description_helpers import (
updateConfigFromSubConfig,
applyValueGettersToContainer,
DeferredDictLookup)

from nupic.frameworks.opf.htmpredictionmodelcallbacks import *
from nupic.frameworks.opf.htm_prediction_model_callbacks import *
from nupic.frameworks.opf.metrics import MetricSpec
from nupic.frameworks.opf.opfutils import (InferenceType,
InferenceElement)
from nupic.frameworks.opf.opf_utils import (InferenceType,
InferenceElement)
from nupic.support import aggregationDivide

from nupic.frameworks.opf.opftaskdriver import (
from nupic.frameworks.opf.opf_task_driver import (
IterationPhaseSpecLearnOnly,
IterationPhaseSpecInferOnly,
IterationPhaseSpecLearnAndInfer)
Expand Down Expand Up @@ -371,7 +371,7 @@
# Task Control parameters for OPFTaskDriver (per opfTaskControlSchema.json)
'taskControl' : {

# Iteration cycle list consisting of opftaskdriver.IterationPhaseSpecXXXXX
# Iteration cycle list consisting of opf_task_driver.IterationPhaseSpecXXXXX
# instances.
'iterationCycle' : [
#IterationPhaseSpecLearnOnly(1000),
Expand Down
Loading