Skip to content

Commit

Permalink
Merge 30018c8 into 9e0fd2a
Browse files Browse the repository at this point in the history
  • Loading branch information
mrJean1 committed Jun 4, 2020
2 parents 9e0fd2a + 30018c8 commit f78e078
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions pympler/asizeof.py
Expand Up @@ -203,7 +203,7 @@ class and the ``... def`` suffix marks the *definition object*.
__all__ = ['adict', 'asized', 'asizeof', 'asizesof',
'Asized', 'Asizer', # classes
'basicsize', 'flatsize', 'itemsize', 'leng', 'refs']
__version__ = '19.03.29'
__version__ = '20.06.04'

# Any classes or types in modules listed in _builtin_modules are
# considered built-in and ignored by default, as built-in functions
Expand Down Expand Up @@ -1497,9 +1497,16 @@ def _numpy_kwds(obj):
# function alen returns the length in number of items
return dict(base=b, item=_sizeof_Cbyte, # not obj.itemsize
leng=_len_numpy,
refs=_numpy_refs,
vari='itemsize')

def _numpy_refs(obj, named):
'''Return the .base object for NumPy slices, views, etc.
'''
return _refs(obj, named, 'base')

_all_lens += (_len_numpy,)
_all_refs += (_numpy_refs,)

_numpy_types = ()
for d in (numpy.array(range(0)), numpy.arange(0),
Expand Down Expand Up @@ -1903,7 +1910,7 @@ def get(self, name, dflt=None):
class Asizer(object):
'''Sizer state and options to accumulate sizes.
'''
_above_ = 1024 # rank only objs of 1K+ size
_above_ = 1024 # rank only objs of size 1K+
_align_ = 8
_clip_ = 80
_code_ = False
Expand Down Expand Up @@ -2105,6 +2112,12 @@ def _sizes(self, objs, sized=None):
t.append(s[i])
return tuple(t)

@property
def above(self):
'''Get the large object size threshold (int).
'''
return self._above_

@property
def align(self):
'''Get the size alignment (int).
Expand Down

0 comments on commit f78e078

Please sign in to comment.