Skip to content

Commit 9233b50

Browse files
committed
Fixed Vispy Error on 64bit systems (6.6)
Added .astype(np.float32) at the end of the array generation.
1 parent dddae06 commit 9233b50

File tree

1 file changed

+22
-10
lines changed

1 file changed

+22
-10
lines changed

notebooks/chapter06_viz/06_vispy.ipynb

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
},
4545
{
4646
"cell_type": "code",
47-
"execution_count": null,
47+
"execution_count": 1,
4848
"metadata": {
4949
"collapsed": false
5050
},
@@ -64,7 +64,7 @@
6464
},
6565
{
6666
"cell_type": "code",
67-
"execution_count": null,
67+
"execution_count": 2,
6868
"metadata": {
6969
"collapsed": false
7070
},
@@ -82,7 +82,7 @@
8282
},
8383
{
8484
"cell_type": "code",
85-
"execution_count": null,
85+
"execution_count": 3,
8686
"metadata": {
8787
"collapsed": false
8888
},
@@ -106,7 +106,7 @@
106106
},
107107
{
108108
"cell_type": "code",
109-
"execution_count": null,
109+
"execution_count": 4,
110110
"metadata": {
111111
"collapsed": false
112112
},
@@ -129,7 +129,7 @@
129129
},
130130
{
131131
"cell_type": "code",
132-
"execution_count": null,
132+
"execution_count": 5,
133133
"metadata": {
134134
"collapsed": false
135135
},
@@ -147,15 +147,27 @@
147147
},
148148
{
149149
"cell_type": "code",
150-
"execution_count": null,
150+
"execution_count": 7,
151151
"metadata": {
152152
"collapsed": false
153153
},
154-
"outputs": [],
154+
"outputs": [
155+
{
156+
"ename": "NameError",
157+
"evalue": "name 'float32' is not defined",
158+
"output_type": "error",
159+
"traceback": [
160+
"\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
161+
"\u001b[1;31mNameError\u001b[0m Traceback (most recent call last)",
162+
"\u001b[1;32m<ipython-input-7-b8fd95d97318>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m()\u001b[0m\n\u001b[0;32m 1\u001b[0m program['a_position'] = np.c_[\n\u001b[1;32m----> 2\u001b[1;33m \u001b[0mnp\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mlinspace\u001b[0m\u001b[1;33m(\u001b[0m\u001b[1;33m-\u001b[0m\u001b[1;36m1.0\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;33m+\u001b[0m\u001b[1;36m1.0\u001b[0m\u001b[1;33m,\u001b[0m \u001b[1;36m1000\u001b[0m\u001b[1;33m,\u001b[0m \u001b[0mdtype\u001b[0m\u001b[1;33m=\u001b[0m\u001b[0mfloat32\u001b[0m\u001b[1;33m)\u001b[0m\u001b[1;33m,\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m\u001b[0;32m 3\u001b[0m np.random.uniform(-0.5, +0.5, 1000, dtype=float32)]\n",
163+
"\u001b[1;31mNameError\u001b[0m: name 'float32' is not defined"
164+
]
165+
}
166+
],
155167
"source": [
156168
"program['a_position'] = np.c_[\n",
157-
" np.linspace(-1.0, +1.0, 1000),\n",
158-
" np.random.uniform(-0.5, +0.5, 1000)]"
169+
" np.linspace(-1.0, +1.0, 1000, dtype=float32),\n",
170+
" np.random.uniform(-0.5, +0.5, 1000, dtype=float32)]"
159171
]
160172
},
161173
{
@@ -244,7 +256,7 @@
244256
"name": "python",
245257
"nbconvert_exporter": "python",
246258
"pygments_lexer": "ipython3",
247-
"version": "3.4.2"
259+
"version": "3.4.1"
248260
}
249261
},
250262
"nbformat": 4,

0 commit comments

Comments
 (0)