-
-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support de/compress_into #26
Conversation
1ad5722
to
1a98c42
Compare
7b832f6
to
ab2d790
Compare
Does adding this significantly increase the install size? I am hoping no, since numpy itself contains all the called code. |
I couldn't find a reliable way to pass the primitive pointer from python/numpy as a ❯ maturin build -i $(which python) --release --out wheels
🔗 Found pyo3 bindings
🐍 Found CPython 3.7m at /home/milesg/Projects/pyrus-cramjam/venv/bin/python
📦 Built source distribution to wheels/cramjam-2.0.0_rc1.tar.gz
warning: version requirement `0.6.0+zstd.1.4.8` for dependency `zstd` includes semver metadata which will be ignored, removing the metadata is recommended to avoid confusion
Compiling pyo3 v0.13.2
Compiling numpy v0.13.0
Compiling cramjam v2.0.0-rc1 (/home/milesg/Projects/pyrus-cramjam)
Finished release [optimized] target(s) in 7.62s
📦 Built wheel for CPython 3.7m to wheels/cramjam-2.0.0_rc1-cp37-cp37m-manylinux2010_x86_64.whl
pyrus-cramjam on support-de-compress-into [⇕] is 📦 v2.0.0-rc1 via 🐍 v3.7.4 (venv) via 🦀 v1.50.0 on ☁️ (eu-north-1) took 8s
❯ ls -ls wheels/
1672 -rw-rw-r-- 1 milesg milesg 1711444 feb. 18 15:20 cramjam-2.0.0_rc1-cp37-cp37m-manylinux2010_x86_64.whl vs current master ❯ maturin build -i $(which python) --release --out wheels
🔗 Found pyo3 bindings
🐍 Found CPython 3.7m at /home/milesg/Projects/pyrus-cramjam/venv/bin/python
📦 Built source distribution to wheels/cramjam-2.0.0_rc1.tar.gz
warning: version requirement `0.6.0+zstd.1.4.8` for dependency `zstd` includes semver metadata which will be ignored, removing the metadata is recommended to avoid confusion
Compiling cramjam v2.0.0-rc1 (/home/milesg/Projects/pyrus-cramjam)
Finished release [optimized] target(s) in 2.01s
📦 Built wheel for CPython 3.7m to wheels/cramjam-2.0.0_rc1-cp37-cp37m-manylinux2010_x86_64.whl
pyrus-cramjam on master is 📦 v2.0.0-rc1 via 🐍 v3.7.4 (venv) via 🦀 v1.50.0 on ☁️ (eu-north-1) took 2s
❯ ls -ls wheels/
1664 -rw-rw-r-- 1 milesg milesg 1700482 feb. 18 15:20 cramjam-2.0.0_rc1-cp37-cp37m-manylinux2010_x86_64.whl It's a good note about perhaps requests for other buffer bytes, but IMO, numpy is so pervasive it's a big plus to support, and it's an eventuality that supporting python file-like objects is a goal; as in #14 |
ab2d790
to
48e9d0a
Compare
https://numpy.org/doc/stable/reference/generated/numpy.ndarray.ctypes.html
I'm not sure if the ctypes pointer is what you want. The point is, that for any numpy array you can do
|
Thanks for that! 💯 I suppose there is a useability portion to the API as well; passing in the array directly to However, to support memoryviews/pointer specific ability, we can do what was done with If you need this support vs what this PR did with numpy, feel free to make an issue. 👍 |
No, I don't immediately need this. You can, after all, just wrap any python buffer in a numpy array anyway! Yes, I think it would be reasonable for the same |
Will close #23