Support with read only in wrappers#3700
Open
BorisTheBrave wants to merge 4 commits intozarr-developers:mainfrom
Open
Support with read only in wrappers#3700BorisTheBrave wants to merge 4 commits intozarr-developers:mainfrom
BorisTheBrave wants to merge 4 commits intozarr-developers:mainfrom
Conversation
d-v-b
reviewed
Feb 11, 2026
| from zarr.core.buffer.core import Buffer, BufferPrototype | ||
|
|
||
|
|
||
| class _CacheState: |
Contributor
There was a problem hiding this comment.
if this has to be a class, it should be a dataclass (so we can initialize it with __init__). and if it doesn't have to be a class (e.g, it's just a collection of attributes, with no methods), we could use a typeddict.
I'm happy to make these changes if that's ok with you @BorisTheBrave
Author
There was a problem hiding this comment.
Sure, I'm happy to hand it over. It has no need to be a class, it's just a collection of properties.
d-v-b
reviewed
Feb 11, 2026
| @@ -71,13 +81,7 @@ class CacheStore(WrapperStore[Store]): | |||
| max_size: int | None | |||
| key_insert_times: dict[str, float] | |||
Contributor
There was a problem hiding this comment.
should this be part of the cache state?
Author
There was a problem hiding this comment.
Logically yes, but as it wasn't marked internal (with an underscore) I felt it was safer to not move it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3699
All three wrapper stores (Latency, Logging, Cache) now support with_read_only.
CacheStore required a bit of changes - some of the mutable state was lifted to another class, so that multiple CacheStore objects could share the same one.
docs/user-guide/*.mdchanges/