@@ -61,8 +61,9 @@ class Array(object):
6161 itemsize
6262 nbytes
6363 nbytes_stored
64- initialized
6564 cdata_shape
65+ nchunks
66+ nchunks_initialized
6667 is_view
6768
6869 Methods
@@ -263,12 +264,6 @@ def nbytes_stored(self):
263264 else :
264265 return m + n
265266
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-
272267 @property
273268 def cdata_shape (self ):
274269 """A tuple of integers describing the number of chunks along each
@@ -277,6 +272,20 @@ def cdata_shape(self):
277272 int (np .ceil (s / c )) for s , c in zip (self ._shape , self ._chunks )
278273 )
279274
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+
280289 @property
281290 def is_view (self ):
282291 """A boolean, True if this array is a view on another array."""
@@ -755,8 +764,8 @@ def __repr__(self):
755764 r += '; nbytes_stored: %s' % human_readable_size (
756765 self .nbytes_stored )
757766 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 )
760769
761770 # filters
762771 if self .filters :
0 commit comments