Commit cc4dff9
top-level functions for reading, creating data (#2463)
* add functions for easy read-only data access
* sync funcs
* make read-only funcs top-level exports
* add create_array, create_group, and tests
* add top-level imports
* add test for top-level exports
* add test for read
* add asserts
* Apply suggestions from code review
* handle sharding in create_array
* tweak
* make logic of _auto_partition better for shard shape
* add dtype parsing, and tweak auto_partitioning func
* sketch of docstring; remove auto chunks / shard shape
* tweak docstring
* docstrings
* ensure tests pass
* tuple -> list
* allow data in create_array
* docstring
* remove auto_partition
* make shape shapelike
* use create_array everywhere in group class
* remove readers
* fix dodgy imports
* compressors -> compression, auto chunking, auto sharding, auto compression, auto filters
* use sane shard shape when there are too few chunks
* fix: allow user-specified filters and compression
* np.dtype[np.generic] -> np.dtype[Any]
* handle singleton compressor / filters input
* default codec config now uses the full config dict
* test for auto sharding
* test
* adds a shards property
* add (typed) functions for resolving codecs
* better codec parsing
* add warning if auto sharding is used
* remove read_array
* rename compression to compressors, and make the docstring for create_array more clear on what filters and compressors mean
* compression -> compressors, shard_shape -> shards, chunk_shape -> chunks
* use typerror instead of valuerror; docstring
* default order is None
* fix circular dep
* format
* fix some tests
* use filters=auto and compressors=auto in Group.create_array
* compression -> compressors
* Update src/zarr/core/group.py
Co-authored-by: Norman Rzepka <[email protected]>
* fix mypy
* narrow type of filters param and compression param
* remove data kwarg to create_array
* mypy fixes
* ensure that we accept dict form of compressor in _parse_chunk_encoding_v2
* fix properties test
* add tests for compressors and filters kwargs to create_array
* add tests for codec inference
* add test for illegal shards kwarg for v2 arrays
* remove redundant test function
* tests and types
* rm print
* types
* resolve cyclic import
* add create_array to async and sync API
* docs for create_array
* rename (Async)Array.create to _create
* adds array_bytes_codec kwarg
* tests
* tests for no filters+compressors
* widen type of FiltersParam to include single numcodecs codec instances
* don't alias None to default codecs in _create_v2
* allow single codec instances for filters, and None for filters / compressor, and condense some tests
* add docstring for None
* single-item tuple for compressors in v2
* Update src/zarr/core/array.py
* tweaks
* pr feedback 1
* tests
* mypy
* rename array_bytes_codec to serializer
* Update src/zarr/api/asynchronous.py
Co-authored-by: Joe Hamman <[email protected]>
* docstrings
* *params -> *like
* *params -> *like, in tests
* adds deprecated compressor arg to Group.create_array
* docs
---------
Co-authored-by: Joe Hamman <[email protected]>
Co-authored-by: Norman Rzepka <[email protected]>
Co-authored-by: Joe Hamman <[email protected]>1 parent 7907852 commit cc4dff9
File tree
33 files changed
+2399
-799
lines changed- src/zarr
- api
- core
- buffer
- metadata
- testing
- tests
- test_codecs
- test_metadata
33 files changed
+2399
-799
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
| |||
46 | 48 | | |
47 | 49 | | |
48 | 50 | | |
| 51 | + | |
| 52 | + | |
49 | 53 | | |
50 | 54 | | |
51 | 55 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
| 12 | + | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
25 | | - | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
| |||
150 | 151 | | |
151 | 152 | | |
152 | 153 | | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | 154 | | |
159 | 155 | | |
160 | 156 | | |
| |||
300 | 296 | | |
301 | 297 | | |
302 | 298 | | |
303 | | - | |
304 | | - | |
| 299 | + | |
| 300 | + | |
305 | 301 | | |
306 | 302 | | |
307 | 303 | | |
| |||
417 | 413 | | |
418 | 414 | | |
419 | 415 | | |
420 | | - | |
| 416 | + | |
421 | 417 | | |
422 | 418 | | |
423 | 419 | | |
| |||
429 | 425 | | |
430 | 426 | | |
431 | 427 | | |
432 | | - | |
| 428 | + | |
433 | 429 | | |
434 | 430 | | |
435 | 431 | | |
| |||
477 | 473 | | |
478 | 474 | | |
479 | 475 | | |
480 | | - | |
| 476 | + | |
481 | 477 | | |
482 | 478 | | |
483 | 479 | | |
| |||
657 | 653 | | |
658 | 654 | | |
659 | 655 | | |
660 | | - | |
| 656 | + | |
661 | 657 | | |
662 | 658 | | |
663 | 659 | | |
| |||
666 | 662 | | |
667 | 663 | | |
668 | 664 | | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
669 | 715 | | |
670 | 716 | | |
671 | 717 | | |
| |||
768 | 814 | | |
769 | 815 | | |
770 | 816 | | |
771 | | - | |
| 817 | + | |
772 | 818 | | |
773 | 819 | | |
774 | 820 | | |
| |||
813 | 859 | | |
814 | 860 | | |
815 | 861 | | |
816 | | - | |
| 862 | + | |
817 | 863 | | |
818 | 864 | | |
819 | 865 | | |
| |||
843 | 889 | | |
844 | 890 | | |
845 | 891 | | |
846 | | - | |
847 | | - | |
| 892 | + | |
| 893 | + | |
848 | 894 | | |
849 | 895 | | |
850 | 896 | | |
| |||
857 | 903 | | |
858 | 904 | | |
859 | 905 | | |
860 | | - | |
| 906 | + | |
| 907 | + | |
861 | 908 | | |
862 | 909 | | |
863 | 910 | | |
| |||
878 | 925 | | |
879 | 926 | | |
880 | 927 | | |
881 | | - | |
882 | | - | |
| 928 | + | |
| 929 | + | |
883 | 930 | | |
884 | 931 | | |
885 | 932 | | |
| |||
914 | 961 | | |
915 | 962 | | |
916 | 963 | | |
917 | | - | |
| 964 | + | |
918 | 965 | | |
919 | 966 | | |
920 | 967 | | |
| |||
925 | 972 | | |
926 | 973 | | |
927 | 974 | | |
928 | | - | |
| 975 | + | |
929 | 976 | | |
930 | 977 | | |
931 | 978 | | |
932 | 979 | | |
933 | 980 | | |
934 | 981 | | |
935 | | - | |
936 | | - | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
937 | 986 | | |
938 | 987 | | |
939 | 988 | | |
| |||
971 | 1020 | | |
972 | 1021 | | |
973 | 1022 | | |
974 | | - | |
| 1023 | + | |
975 | 1024 | | |
976 | 1025 | | |
977 | 1026 | | |
| |||
994 | 1043 | | |
995 | 1044 | | |
996 | 1045 | | |
997 | | - | |
| 1046 | + | |
998 | 1047 | | |
999 | 1048 | | |
1000 | 1049 | | |
| |||
1173 | 1222 | | |
1174 | 1223 | | |
1175 | 1224 | | |
1176 | | - | |
| 1225 | + | |
1177 | 1226 | | |
1178 | 1227 | | |
1179 | 1228 | | |
| |||
1196 | 1245 | | |
1197 | 1246 | | |
1198 | 1247 | | |
1199 | | - | |
| 1248 | + | |
1200 | 1249 | | |
1201 | 1250 | | |
1202 | 1251 | | |
| |||
0 commit comments