Skip to content

Conversation

@alimanfoo
Copy link
Member

This PR adds a new store class which stores chunk files in a nested directory structure rather than all chunk files for a given array in the same directory. Resolves #155.

@alimanfoo alimanfoo added this to the v2.2 milestone Nov 1, 2017
@alimanfoo alimanfoo added the in progress Someone is currently working on this label Nov 1, 2017
@alimanfoo
Copy link
Member Author

This is working, e.g., comparison between standard directory store and nested directory store:

In [23]: import zarr

In [24]: store = zarr.DirectoryStore('flat')

In [25]: root = zarr.group(store=store)

In [26]: foo = root.create_group('foo')

In [27]: z = foo.zeros('bar', shape=(10, 10), chunks=(5, 5))

In [28]: z[:] = 42

In [29]: !tree -a flat
flat
├── foo
│   ├── bar
│   │   ├── 0.0
│   │   ├── 0.1
│   │   ├── 1.0
│   │   ├── 1.1
│   │   ├── .zarray
│   │   └── .zattrs
│   ├── .zattrs
│   └── .zgroup
├── .zattrs
└── .zgroup

2 directories, 10 files

In [30]: store = zarr.NestedDirectoryStore('nested')

In [31]: root = zarr.group(store=store)

In [32]: foo = root.create_group('foo')

In [33]: z = foo.zeros('bar', shape=(10, 10), chunks=(5, 5))

In [34]: z[:] = 42

In [35]: !tree -a nested
nested
├── foo
│   ├── bar
│   │   ├── 0
│   │   │   ├── 0
│   │   │   └── 1
│   │   ├── 1
│   │   │   ├── 0
│   │   │   └── 1
│   │   ├── .zarray
│   │   └── .zattrs
│   ├── .zattrs
│   └── .zgroup
├── .zattrs
└── .zgroup

4 directories, 10 files

cc @axtimwalde

@axtimwalde
Copy link
Contributor

Cool!

@jakirkham
Copy link
Member

Will this become the new default?

@alimanfoo
Copy link
Member Author

alimanfoo commented Nov 1, 2017 via email

@alimanfoo alimanfoo merged commit 5f254f0 into master Nov 10, 2017
@alimanfoo alimanfoo removed the in progress Someone is currently working on this label Nov 10, 2017
@alimanfoo alimanfoo deleted the nested-directory-store-20171031 branch November 10, 2017 11:10
@alimanfoo alimanfoo added enhancement New features or improvements release notes done Automatically applied to PRs which have release notes. labels Nov 19, 2017
@joshmoore joshmoore mentioned this pull request Jan 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New features or improvements release notes done Automatically applied to PRs which have release notes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants