Skip to content
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

Proof of concept of "buffer_description_api" and xarray reference API bridge #1513

Open
wants to merge 21 commits into
base: master
Choose a base branch
from

Conversation

samuelgarcia
Copy link
Contributor

Given the idea of @bendichter and this gist

Here a very very early stage of a very very proof of concept of the "buffer_description_api" for analogsignal chunk.

The idea/goal is:

  • have a simple buffer description for analogsignal for binary or hdf5 cases (maybe more)
  • this description can be exported to json
  • this description can be easily transformed to the xarray/zarr reference external API
  • make so file cloud ready for streaming chunk of traces

See also kerchunk

rfs = dict()
rfs["version"] = 1
rfs["refs"] = dict()
rfs["refs"][".zgroup"] = json.dumps(dict(zarr_format=2))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need the dumps command anymore

chunk_size = array_size * dtype.itemsize
rfs["refs"][f"{stream_id}/0.0"] = [str(descr["file_path"]), descr["file_offset"], chunk_size]
rfs["refs"][f"{stream_id}/.zarray"] =json.dumps(zarray)
rfs["refs"][f"{stream_id}/.zattrs"] =json.dumps(zattrs)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nor here

@bendichter
Copy link
Contributor

Looks good!

@apdavison apdavison added this to the future milestone Jul 26, 2024
…_buffer_description_api=True

This should also solve the memmap and memmory leak problem.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants