MCPcopy
hub / github.com/pyodide/pyodide / test_numpy

Function test_numpy

packages/numpy/test_numpy.py:5–24  ·  view source on GitHub ↗
(selenium)

Source from the content-addressed store, hash-verified

3
4
5def test_numpy(selenium):
6 selenium.load_package("numpy")
7 selenium.run(
8 """
9 import numpy
10 x = numpy.ones((32, 64))
11 """
12 )
13 selenium.run_js(
14 """
15 let xpy = pyodide.runPython('x');
16 self.x = xpy.toJs();
17 xpy.destroy();
18 """
19 )
20 assert selenium.run_js("return x.length === 32")
21 for i in range(32):
22 assert selenium.run_js(f"return x[{i}].length == 64")
23 for j in range(64):
24 assert selenium.run_js(f"return x[{i}][{j}] == 1")
25
26
27def test_typed_arrays(selenium):

Callers

nothing calls this directly

Calls 1

runMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…