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

Variable length string array support #94

Merged
merged 11 commits into from
Nov 13, 2023

Conversation

minnerbe
Copy link
Contributor

This is a working but far-from-optimal solution to read and write variable length (vlen) string arrays, which are part of hdf5 and zarr but currently not supported by the N5 API.

Basically, I've created a DataBlock<String[]> that handles (de-)serialization of a C-style null-terminated string array. This necessitates that the block implements constructors for String[] and byte[], which may be a sign that IO operations and serialization logic is not sufficiently separated for non-primitive types.

I would propose this PR as a starting point towards separating IO operations (raw bytes) from custom serialization logic such that other data types may easily be added in the future; see also Issue #93 -- thanks @bogovicj!

@axtimwalde, what's you opinion on this topic?

@minnerbe minnerbe marked this pull request as ready for review March 11, 2023 01:16
@minnerbe
Copy link
Contributor Author

minnerbe commented Mar 11, 2023

Realizing that there still is some way to go to achieve #93, I would propose to include this now to support string array IO as soon as possible.

See also the corresponding pull requests in hdf5 and zarr.

@mkitti
Copy link
Contributor

mkitti commented Oct 19, 2023

@minnerbe
Copy link
Contributor Author

AFAIK, chunking is only done on the de-serialized arrays. So, as soon as N5 supports this in general, this should also work for String arrays.

@bogovicj bogovicj merged commit 4d5cc7c into saalfeldlab:master Nov 13, 2023
3 checks passed
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