10
10
11
11
def empty (shape , chunks , dtype = None , cname = None , clevel = None , shuffle = None ,
12
12
synchronized = True ):
13
- """TODO"""
13
+ """Create an empty array.
14
+
15
+ Parameters
16
+ ----------
17
+ shape : int or tuple of ints
18
+ Array shape.
19
+ chunks : int or tuple of ints
20
+ Chunk shape.
21
+ dtype : string or dtype, optional
22
+ NumPy dtype.
23
+ cname : string, optional
24
+ Name of compression library to use, e.g., 'blosclz', 'lz4', 'zlib',
25
+ 'snappy'.
26
+ clevel : int, optional
27
+ Compression level, 0 means no compression.
28
+ shuffle : int, optional
29
+ Shuffle filter, 0 means no shuffle, 1 means byte shuffle, 2 means
30
+ bit shuffle.
31
+ synchronized : bool, optional
32
+ If True, each chunk will be protected with a lock to prevent data
33
+ collision during write operations.
34
+
35
+ Returns
36
+ -------
37
+ z : zarr.ext.Array
38
+
39
+ """
14
40
15
41
return _ext .Array (shape , chunks = chunks , dtype = dtype , cname = cname ,
16
42
clevel = clevel , shuffle = shuffle ,
@@ -19,16 +45,69 @@ def empty(shape, chunks, dtype=None, cname=None, clevel=None, shuffle=None,
19
45
20
46
def zeros (shape , chunks , dtype = None , cname = None , clevel = None , shuffle = None ,
21
47
synchronized = True ):
22
- """TODO"""
48
+ """Create an array filled with zeros.
49
+
50
+ Parameters
51
+ ----------
52
+ shape : int or tuple of ints
53
+ Array shape.
54
+ chunks : int or tuple of ints
55
+ Chunk shape.
56
+ dtype : string or dtype, optional
57
+ NumPy dtype.
58
+ cname : string, optional
59
+ Name of compression library to use, e.g., 'blosclz', 'lz4', 'zlib',
60
+ 'snappy'.
61
+ clevel : int, optional
62
+ Compression level, 0 means no compression.
63
+ shuffle : int, optional
64
+ Shuffle filter, 0 means no shuffle, 1 means byte shuffle, 2 means
65
+ bit shuffle.
66
+ synchronized : bool, optional
67
+ If True, each chunk will be protected with a lock to prevent data
68
+ collision during write operations.
69
+
70
+ Returns
71
+ -------
72
+ z : zarr.ext.Array
73
+
74
+ """
23
75
24
76
return _ext .Array (shape , chunks = chunks , dtype = dtype , cname = cname ,
25
77
clevel = clevel , shuffle = shuffle , fill_value = 0 ,
26
78
synchronized = synchronized )
27
79
28
80
29
81
def ones (shape , chunks , dtype = None , cname = None , clevel = None , shuffle = None ,
30
- synchronized = True ):
31
- """TODO"""
82
+ synchronized = True ):
83
+ """Create an array filled with ones.
84
+
85
+ Parameters
86
+ ----------
87
+ shape : int or tuple of ints
88
+ Array shape.
89
+ chunks : int or tuple of ints
90
+ Chunk shape.
91
+ dtype : string or dtype, optional
92
+ NumPy dtype.
93
+ cname : string, optional
94
+ Name of compression library to use, e.g., 'blosclz', 'lz4', 'zlib',
95
+ 'snappy'.
96
+ clevel : int, optional
97
+ Compression level, 0 means no compression.
98
+ shuffle : int, optional
99
+ Shuffle filter, 0 means no shuffle, 1 means byte shuffle, 2 means
100
+ bit shuffle.
101
+ synchronized : bool, optional
102
+ If True, each chunk will be protected with a lock to prevent data
103
+ collision during write operations.
104
+
105
+ Returns
106
+ -------
107
+ z : zarr.ext.Array
108
+
109
+ """
110
+
32
111
33
112
return _ext .Array (shape , chunks = chunks , dtype = dtype , cname = cname ,
34
113
clevel = clevel , shuffle = shuffle , fill_value = 1 ,
@@ -37,7 +116,35 @@ def ones(shape, chunks, dtype=None, cname=None, clevel=None, shuffle=None,
37
116
38
117
def full (shape , chunks , fill_value , dtype = None , cname = None , clevel = None ,
39
118
shuffle = None , synchronized = True ):
40
- """TODO"""
119
+ """Create an array filled with `fill_value`.
120
+
121
+ Parameters
122
+ ----------
123
+ shape : int or tuple of ints
124
+ Array shape.
125
+ chunks : int or tuple of ints
126
+ Chunk shape.
127
+ fill_value : object
128
+ Default value to use for uninitialised portions of the array.
129
+ dtype : string or dtype, optional
130
+ NumPy dtype.
131
+ cname : string, optional
132
+ Name of compression library to use, e.g., 'blosclz', 'lz4', 'zlib',
133
+ 'snappy'.
134
+ clevel : int, optional
135
+ Compression level, 0 means no compression.
136
+ shuffle : int, optional
137
+ Shuffle filter, 0 means no shuffle, 1 means byte shuffle, 2 means
138
+ bit shuffle.
139
+ synchronized : bool, optional
140
+ If True, each chunk will be protected with a lock to prevent data
141
+ collision during write operations.
142
+
143
+ Returns
144
+ -------
145
+ z : zarr.ext.Array
146
+
147
+ """
41
148
42
149
return _ext .Array (shape , chunks = chunks , dtype = dtype , cname = cname ,
43
150
clevel = clevel , shuffle = shuffle , fill_value = fill_value ,
@@ -46,7 +153,33 @@ def full(shape, chunks, fill_value, dtype=None, cname=None, clevel=None,
46
153
47
154
def array (data , chunks = None , dtype = None , cname = None , clevel = None ,
48
155
shuffle = None , synchronized = True , fill_value = None ):
49
- """TODO"""
156
+ """Create an array filled with `data`.
157
+
158
+ Parameters
159
+ ----------
160
+ data : array_like
161
+ Data to store.
162
+ chunks : int or tuple of ints
163
+ Chunk shape.
164
+ dtype : string or dtype, optional
165
+ NumPy dtype.
166
+ cname : string, optional
167
+ Name of compression library to use, e.g., 'blosclz', 'lz4', 'zlib',
168
+ 'snappy'.
169
+ clevel : int, optional
170
+ Compression level, 0 means no compression.
171
+ shuffle : int, optional
172
+ Shuffle filter, 0 means no shuffle, 1 means byte shuffle, 2 means
173
+ bit shuffle.
174
+ synchronized : bool, optional
175
+ If True, each chunk will be protected with a lock to prevent data
176
+ collision during write operations.
177
+
178
+ Returns
179
+ -------
180
+ z : zarr.ext.Array
181
+
182
+ """
50
183
51
184
# ensure data is array-like
52
185
if not hasattr (data , 'shape' ) or not hasattr (data , 'dtype' ):
0 commit comments