Code Monkey home page Code Monkey logo

Comments (6)

FrancescAlted avatar FrancescAlted commented on July 22, 2024

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.

esc avatar esc commented on July 22, 2024

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.

mrocklin avatar mrocklin commented on July 22, 2024

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.

jcrist avatar jcrist commented on July 22, 2024

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.

esc avatar esc commented on July 22, 2024

@jcrist that sounds right.

from python-blosc.

esc avatar esc commented on July 22, 2024

@mrocklin I am assuming it is O.K. to close this since Dask now has compression support.

from python-blosc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.