From 4df7e6c953edd7030a77a92cc4671487393ff607 Mon Sep 17 00:00:00 2001 From: chrox Date: Sat, 25 Apr 2015 13:52:07 +0800 Subject: [PATCH] Reflect using pkg_resources to locate resource files as implemented in #1902. --- examples/NuPIC Walkthrough.ipynb | 28 +++------------------------- 1 file changed, 3 insertions(+), 25 deletions(-) diff --git a/examples/NuPIC Walkthrough.ipynb b/examples/NuPIC Walkthrough.ipynb index 1173c6660e..7565827f37 100644 --- a/examples/NuPIC Walkthrough.ipynb +++ b/examples/NuPIC Walkthrough.ipynb @@ -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\u001b[0m in \u001b[0;36m\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": {}, @@ -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", @@ -1567,4 +1545,4 @@ "metadata": {} } ] -} \ No newline at end of file +}