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

vlmeta parameter in kwargs? #109

Open
aleixalcacer opened this issue May 10, 2023 · 1 comment
Open

vlmeta parameter in kwargs? #109

aleixalcacer opened this issue May 10, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@aleixalcacer
Copy link
Member

Hello again, it could be interesting to pass the vlmeta parameter in the kwargs (passing the meta parameter in kwargs is already supported)?

I'm interested because I'm defining a codec in which I need to read/write information that could be stored in the vlmeta parameter.

My use case :

# encoder and decoder is already defined and registered

cparams = {
    'codec': codec_id,
    'codec_meta': 0,
    'nthreads': 1,
    'filters': [],
    'splitmode': blosc2.SplitMode.NEVER_SPLIT,
}

dparams = {
    'nthreads': 1,
}

 c_img = blosc2.asarray(img, chunks=chunks, blocks=blocks, cparams=cparams, dparams=dparams)

It would be nice if I could pass the vlmeta as kwargs and have it serialized before compression. I think, it could be something like:

# encoder and decoder is already defined and registered

cparams = {
    'codec': codec_id,
    'codec_meta': 0,
    'nthreads': 1,
    'filters': [],
    'splitmode': blosc2.SplitMode.NEVER_SPLIT,
}

dparams = {
    'nthreads': 1,
}

vlmeta = {
  'my_codec': my_info
}

 c_img = blosc2.asarray(img, chunks=chunks, blocks=blocks, cparams=cparams, dparams=dparams, vlmeta=vlmeta)

I know it's not ideal in terms of performance (as they will have to be rewritten every time you compress a chunk). But since it's optional, it shouldn't affect users who care about performance.

If it seems good to you and you don't see any inconvenience, can I start with it and create a PR?

Aleix :)

@aleixalcacer aleixalcacer added the enhancement New feature or request label May 10, 2023
@FrancescAlted
Copy link
Member

Sorry for the late reply. I like your proposal, so if you are still interested, please go ahead with a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants