diff options
author | Jon Nordby <jononor@gmail.com> | 2025-04-27 21:38:29 +0200 |
---|---|---|
committer | Jon Nordby <jononor@gmail.com> | 2025-05-02 21:00:12 +0200 |
commit | be9f6b6e8e39a711dcfa7806f894b8ec3ff49ca9 (patch) | |
tree | 9b8a0c16ac47a7084b52bdf458f5d5a683b001c0 /bindings/test_galearn_pdm.py | |
parent | 594bdb32b9d0648ab4718b3672f54008c46ee3a6 (diff) |
bindings: Example of using pybind11 with numpy
Diffstat (limited to 'bindings/test_galearn_pdm.py')
-rw-r--r-- | bindings/test_galearn_pdm.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/bindings/test_galearn_pdm.py b/bindings/test_galearn_pdm.py new file mode 100644 index 0000000..43cb58e --- /dev/null +++ b/bindings/test_galearn_pdm.py @@ -0,0 +1,16 @@ + +import galearn_pdm +import numpy + +def test_one(): + + inp = numpy.ones(shape=10, dtype=numpy.uint8) + out = numpy.zeros(shape=10, dtype=numpy.int16) + + galearn_pdm.process(inp, out) + print(out) + assert out[0] == 2 + assert out[-1] == 2 + +if __name__ == '__main__': + test_one() |