pympler: asizeof(obj) leads to a negative base ValueError
I am trying to estimate the size of a python object that is a subclass of an astropy.Table
However, I receive a ValueError: invalid option: base=-391848 error.
Does anyone have suggestions on why this is occurring/how I can fix this?
MWE:
%pip install -q lightkurve
%pip install -q pympler
import lightkurve as lk
from pympler import asizeof
import numpy as np
import os
lc = lk.search_lightcurve("TOI 588", author="SPOC").download_all().stitch().remove_nans()
asizeof.asizeof(lc)
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
[<ipython-input-13-88b6425eddfd>](https://localhost:8080/#) in <module>()
8
9 lc = lk.search_lightcurve("TOI 588", author="SPOC").download_all().stitch().remove_nans()
---> 10 asizeof.asizeof(lc)
30 frames
[/usr/local/lib/python3.7/dist-packages/pympler/asizeof.py](https://localhost:8080/#) in reset(self, base, item, leng, refs, both, kind, type, vari)
1190 '''
1191 if base < 0:
-> 1192 raise ValueError('invalid option: %s=%r' % ('base', base))
1193 else:
1194 self.base = base
ValueError: invalid option: base=-391848
About this issue
- Original URL
- State: open
- Created 4 years ago
- Comments: 17 (10 by maintainers)
Commits related to this issue
- Issue 151 Fix for numpy.tile issue #151. — committed to mrJean1/pympler by mrJean1 2 years ago
A patch for
asizeof.pyhas been submitted. Until that patch is merged intoPympler, here is a link toasizeof.pyversion 24.08.21.Will investigate.
CORRECTION. Thank you! I’m able to duplicate the problem with Python 3.10.5 (on macOS and Apple Si), but only with
asizeofversion 21.08.09 or older. More recent versions do not exhibit the issue, however those may not have been pulled intopympleryet.Here is a link to
asizeofversion 22.06.30 for your consideration. Instead of …use …