Skip to content
This repository has been archived by the owner on Jun 21, 2022. It is now read-only.

Commit

Permalink
Merge pull request #182 from douglasdavis/add-ndim-propety
Browse files Browse the repository at this point in the history
Add ndim property and fix empty chunk return
  • Loading branch information
jpivarski authored Aug 27, 2019
2 parents 423ca48 + af418a3 commit a9604bb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions awkward/array/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ def dtype(self):
def shape(self):
return self.type.shape

@property
def ndim(self):
return len(self.shape)

def _try_tolist(self, x):
try:
return x.tolist()
Expand Down
1 change: 1 addition & 0 deletions awkward/array/chunked.py
Original file line number Diff line number Diff line change
Expand Up @@ -726,6 +726,7 @@ def _util_columns(self, seen):
self.knowchunksizes(chunkid + 1)
if self._chunksizes[chunkid] > 0:
return self._util_columns_descend(self._chunks[chunkid], seen)
return []

def _util_rowname(self, seen):
if id(self) in seen:
Expand Down
2 changes: 1 addition & 1 deletion awkward/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import re

__version__ = "0.12.6"
__version__ = "0.12.7"
version = __version__
version_info = tuple(re.split(r"[-\.]", __version__))

Expand Down

0 comments on commit a9604bb

Please sign in to comment.