Code Monkey home page Code Monkey logo

Comments (1)

FrancescAlted avatar FrancescAlted commented on August 25, 2024

Yes, you can do that with the current API. If you want to use the basic SChunk API, you can build a large container having default values with blosc2_schunk_fill_special(). This does not consume storage resources, but rather uses a special storage mechanism, so it can be as large as you want. Then, you can use blosc2_schunk_set_slice_buffer() for setting actual values. For reading, you can use the blosc2_schunk_get_slice_buffer() counterpart.

Alternatively, you may want to use the higher level Blosc2 NDim API; for example, use b2nd_empty() to create a big (empty) array, and then b2nd_set_slice_cbuffer() and b2nd_get_slice_cbuffer() for writing and reading respectively. These are the equivalents of the SChunk calls above, but for NDim containers, so internally they work the same.

Finally, you don't necessarily need to use the sparse format for using the APIs above, but it is true that for writing concurrently, the sparse format is more convenient. Mind that you will have to provide all the locking mechanism (if needed) by yourself, as Blosc2 does not provide protections for concurrent processes writing the same file.

Hope this helps.

from c-blosc2.

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.