Skip to content

Commit

Permalink
Reflect using pkg_resources to locate resource files
Browse files Browse the repository at this point in the history
as implemented in numenta#1902.
  • Loading branch information
chrox committed Apr 25, 2015
1 parent 3bc37ef commit 4df7e6c
Showing 1 changed file with 3 additions and 25 deletions.
28 changes: 3 additions & 25 deletions examples/NuPIC Walkthrough.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -880,28 +880,6 @@
"From `examples/opf/clients/hotgym/simple/hotgym.py`"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"model = ModelFactory.create(MODEL_PARAMS)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"ename": "NameError",
"evalue": "name 'ModelFactory' is not defined",
"output_type": "pyerr",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-34-0a1440b445bd>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mmodel\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mModelFactory\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcreate\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mMODEL_PARAMS\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;31mNameError\u001b[0m: name 'ModelFactory' is not defined"
]
}
],
"prompt_number": 34
},
{
"cell_type": "markdown",
"metadata": {},
Expand Down Expand Up @@ -1163,9 +1141,9 @@
"cell_type": "code",
"collapsed": false,
"input": [
"from nupic.data.datasethelpers import findDataset\n",
"from pkg_resources import resource_filename\n",
"\n",
"datasetPath = findDataset(\"extra/hotgym/hotgym.csv\")\n",
"datasetPath = resource_filename(\"nupic.datafiles\", \"extra/hotgym/hotgym.csv\")\n",
"print datasetPath\n",
"\n",
"with open(datasetPath) as inputFile:\n",
Expand Down Expand Up @@ -1567,4 +1545,4 @@
"metadata": {}
}
]
}
}

0 comments on commit 4df7e6c

Please sign in to comment.