Skip to content

Commit

Permalink
fix ruff issues in notebook
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfikl authored and inducer committed Aug 17, 2024
1 parent 104937c commit 8c83e00
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions examples/ipython-demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
},
"outputs": [],
"source": [
"from __future__ import division\n",
"import numpy as np\n",
"\n",
"import pyopencl as cl\n",
"import pyopencl.array"
]
Expand Down Expand Up @@ -126,7 +126,8 @@
"a = cl.array.empty(queue, n, dtype=np.float32)\n",
"a.fill(15)\n",
"\n",
"b_host = np.random.randn(n).astype(np.float32)\n",
"rng = np.random.default_rng()\n",
"b_host = rng.normal(size=n).astype(np.float32)\n",
"b = cl.array.to_device(queue, b_host)\n",
"\n",
"c = cl.array.empty_like(a)"
Expand All @@ -152,7 +153,7 @@
},
"outputs": [],
"source": [
"sum_vector(queue, (n,), None, a.data, b.data, c.data)"
"sum_vector(queue, (n,), None, a.data, b.data, c.data) # noqa: F821"
]
},
{
Expand Down Expand Up @@ -195,7 +196,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.5"
"version": "3.12.4"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 8c83e00

Please sign in to comment.