keller-mark / pizzarr

Slice into Zarr arrays in R 🍕
https://keller-mark.github.io/pizzarr/
MIT License
25 stars 2 forks source link

store$contains_item for sub_paths? #72

Open keller-mark opened 1 month ago

keller-mark commented 1 month ago

User story

Currently, contains_item returns false for parts of keys. For example if there is something at /foo/bar/.zattrs it will only return true for the full path and not necessarily /foo only

Preferred solution

Possible alternatives

keller-mark commented 2 weeks ago

Behavior should be the same between all stores (e.g., MemoryStore and DirectoryStore) - currently I think it is not as file.exists will return TRUE for a directory.

Also, behavior should be consistent with Python. If needed, we can add an argument like $contains_item(include_ancestors = FALSE)