-
Notifications
You must be signed in to change notification settings - Fork 6
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
[Feature]: Use copy_store
for copying existing zarr data
#191
Comments
It would be useful if you could provide a code example of how you are copying the data right now or pseudo-code to show more specifically which kind of data you need to copy. E.g., Is this for individual datasets you want to copy or is this for more complex structures, e.g., an entire Brainstorming: Some ideas for implementing the requested feature For individual datasets, e.g.
For whole groups, e.g., an entire |
Right, sorry. I was talking about individual datasets. Doing something like this works, and the zarr data are not read eagerly, which is great: import datetime
import pynwb
import zarr
nwb = pynwb.NWBFile(
session_id='test',
session_description='test',
identifier='12345',
session_start_time=(
datetime.datetime.now()
),
processing=[
pynwb.TimeSeries(
name='running_speed',
data=zarr.open('s3://test/running_speed.zarr'),
unit='m/s',
rate=60.0,
starting_time=0.0,
)
],
) If the intermediate zarr data were written with some optimized chunking/compression config, I'd just like to include the data as-is, rather than re-do the compression on write to NWB-zarr. |
Thanks for the clarification and helpful example. In that case I would propose the following approach:
With this, your example would change to:
|
@bjhardcastle is this something you are interested in contributing a PR for? |
@oruebel Yes potentially, just not sure when I'll get time to work on it. |
What would you like to see added to HDMF-ZARR?
I'd like to be able to add data from an existing zarr store, with the same compression it used originally, in an efficient way.
As I understand it at the moment, with
use_links=False
the data is downloaded, uncompressed, then written to the new NWB's zarr store with a new compression configuration.Is your feature request related to a problem?
No response
What solution would you like?
The zarr library has a function doing a more efficient version of this, which copies the original compressed data directly:
https://zarr.readthedocs.io/en/stable/api/convenience.html#zarr.convenience.copy_store
Could it be suitable for use when such zarr->zarr copy operations are detected?
Do you have any interest in helping implement the feature?
Yes.
Code of Conduct
The text was updated successfully, but these errors were encountered: