You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 0753fa7
Browse filesBrowse the repository at this point in the historyBrowse files
`c2array` imported `proxy` at module level, and had to: `C2NDSource`
subclasses `ByteRangeNDSource`, which a class statement needs at import
time. The suggested fix -- a function-local import -- could not work for
that reason, and moving the import in `__init__` could not either:
`embed_store` and `dict_store` are bound at lines 565-566 and both reach
`c2array` for `C2Array`, while `lazyexpr` reaches `proxy` directly for
`convert_dtype`. So `proxy.py` was dragged in ahead of `schunk`,
`indexing` and `lazyexpr` by three independent paths, and could import
none of them at module level without `import blosc2` failing outright.
The half those modules actually want moves to `blosc2/proxy_source.py`:
the `ProxySource`/`ProxyNDSource` protocol, the frame reading (header,
offsets, chunk and block extents, splicing), `ByteRangeNDSource`,
`FsspecNDSource`, `convert_dtype` and the block-granularity thresholds.
It reaches into the package for nothing past what `blosc2_ext` binds
first. `proxy.py` keeps the `Proxy` itself and imports the rest back,
re-exporting the four classes so `blosc2.proxy.X` still answers -- as
`blosc2.X` does, unchanged, which is what the docs autoclass.
`.proxy` is now bound after `.schunk` and `.indexing`, and the proof is
in the diff: `_reopen_cache`'s function-local `from blosc2.schunk import
_set_default_dparams`, which was function-local for exactly this reason,
is a module-level import again.
What moved for good are the tuning constants -- `BLOCK_MIN_CBYTES` and
its neighbours are `blosc2.proxy_source.BLOCK_MIN_CBYTES` now, since
re-exporting a constant by value would leave anyone setting it on
`blosc2.proxy` silently patching a copy nothing reads. The two benches
and the tests that set them are updated to say where they live.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
0 commit comments