Skip to content

Change 'compressor' encoding so that it contains 'id'#270

Open
wachsylon wants to merge 5 commits into
xpublish-community:mainfrom
wachsylon:patch-2
Open

Change 'compressor' encoding so that it contains 'id'#270
wachsylon wants to merge 5 commits into
xpublish-community:mainfrom
wachsylon:patch-2

Conversation

@wachsylon
Copy link
Copy Markdown

So this is based on many assumptions that I am too lazy to validate :) but it seems plausible to me and it fixes an issue:

If a .zarray of a variable is retrieved, a pure dict is returned. I am not sure what fastapi is doing with that, but obviously, the return is a JSON. If a compressor is set, I guess the __dict__ representation of it is used.

The problem is, there is a difference between cd and cc, defined as:

import numcodecs
codec = numcodecs.Blosc(cname='zstd', clevel=5, shuffle=1, blocksize=0)
cd=codec.__dict__
cc=codec.get_config()

I assume that we want to have cc because it contains a id keyword. Without this, it is not clear that blosc was actually used.

@wachsylon
Copy link
Copy Markdown
Author

i now see that this is pretty similar to jsonify_zmetadata maybe it is possible to use this as well

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.

1 participant