Comments (6)
I think what you are after is blosc_compress_ctx
and blosc_decompress_ctx
:
https://github.com/Blosc/c-blosc/blob/master/blosc/blosc.h#L184
https://github.com/Blosc/c-blosc/blob/master/blosc/blosc.h#L222
Using these with numinternalthreads=1
will allow you to use them from multithreaded apps without locks. Also, you can select different compressors like blosclz, lz4, lz4hc, snappy and zlib, and if you want to get rid of the internal blocking you can do that by using blocksize=nbytes
.
Although these _ctx
functions are not wrapped yet in python-blosc, they would be a nice addition and we would welcome a PR indeed.
from python-blosc.
Two things about the functions you are suggesting.
blosc.lzo.compress
doesn't make sense right now, since we don't handle lzo.
blosc.shuffle
I am not sure if this even makes sense with larger blocksizes
Also, there must be bindings for the compressors you want. Would it make sense to use those directly? Or are you looking for a uniform interface to them?
from python-blosc.
I'm looking for a uniform interface to the relevant options maintained by people that I trust care that it was done well.
from python-blosc.
Although these _ctx functions are not wrapped yet in python-blosc, they would be a nice addition and we would welcome a PR indeed.
From the comment here, it sounds like init
can't be called if you want to use the context functions? If this is the case, then some workaround would be needed to avoid calling init
in blosc/__init__.py
on import.
Edit: From reading the source, it appears that there's no harm in using the *_ctx
calls after blosc_init
has been called, except that a global threadpool is created and never used.
from python-blosc.
@jcrist that sounds right.
from python-blosc.
@mrocklin I am assuming it is O.K. to close this since Dask now has compression support.
from python-blosc.
Related Issues (20)
- Issues decompressing bytes from files HOT 1
- Replace obsolete `popen2` HOT 1
- Properly identify vendored `cpuinfo.py` version
- Blosc_ROOT cmake warning: Policy CMP0074 is not set HOT 2
- "RuntimeError: Cannot decompress" for a compressed sequence of more than 7240 zero bytes HOT 1
- Very bad compression on short inputs 1-127 bytes long HOT 5
- “python_requires” should be set with “>=3.6”, as blosc 1.10.6 is not compatible with all Python versions. HOT 2
- wrong setuptools build command
- Concatenate two blosc compressed bytes objects HOT 2
- LICENSES/BLOSC.txt HOT 4
- Rename default branch HOT 1
- Update pypi with latest blosc version HOT 3
- Wheel for Python 3.10 and Python 3.11 HOT 3
- Cannot install blosc 1.11.0 on apple M1 machine HOT 3
- decompress in fore-end HOT 1
- README link to python-blosc2 seems useful HOT 1
- __pack_tensor__ must be made portable and not depend on Python HOT 2
- __pack_tensor__ should be in the beginning of the file to avoid seeking the whole file HOT 2
- Python 3.12 compatibility HOT 6
- Numpy 2 compatibility
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-blosc.