@@ -61,8 +61,9 @@ class Array(object):
61
61
itemsize
62
62
nbytes
63
63
nbytes_stored
64
- initialized
65
64
cdata_shape
65
+ nchunks
66
+ nchunks_initialized
66
67
is_view
67
68
68
69
Methods
@@ -263,12 +264,6 @@ def nbytes_stored(self):
263
264
else :
264
265
return m + n
265
266
266
- @property
267
- def initialized (self ):
268
- """The number of chunks that have been initialized with some data."""
269
- return sum (1 for k in listdir (self ._chunk_store , self ._path )
270
- if k not in [array_meta_key , attrs_key ])
271
-
272
267
@property
273
268
def cdata_shape (self ):
274
269
"""A tuple of integers describing the number of chunks along each
@@ -277,6 +272,20 @@ def cdata_shape(self):
277
272
int (np .ceil (s / c )) for s , c in zip (self ._shape , self ._chunks )
278
273
)
279
274
275
+ @property
276
+ def nchunks (self ):
277
+ """Total number of chunks."""
278
+ return reduce (operator .mul , self .cdata_shape )
279
+
280
+ @property
281
+ def nchunks_initialized (self ):
282
+ """The number of chunks that have been initialized with some data."""
283
+ return sum (1 for k in listdir (self ._chunk_store , self ._path )
284
+ if k not in [array_meta_key , attrs_key ])
285
+
286
+ # backwards compability
287
+ initialized = nchunks_initialized
288
+
280
289
@property
281
290
def is_view (self ):
282
291
"""A boolean, True if this array is a view on another array."""
@@ -755,8 +764,8 @@ def __repr__(self):
755
764
r += '; nbytes_stored: %s' % human_readable_size (
756
765
self .nbytes_stored )
757
766
r += '; ratio: %.1f' % (self .nbytes / self .nbytes_stored )
758
- n_chunks = reduce ( operator . mul , self .cdata_shape )
759
- r += '; initialized: %s/%s' % ( self .initialized , n_chunks )
767
+ r += '; initialized: %s/%s' % ( self .nchunks_initialized ,
768
+ self .nchunks )
760
769
761
770
# filters
762
771
if self .filters :
0 commit comments