scikit-spectra icon indicating copy to clipboard operation
scikit-spectra copied to clipboard

endless recursion using MetaPandasObject and MetaDataFrame

Open Geekly opened this issue 7 years ago • 0 comments

This may not be relevant for python 2.7, so ignore if appropriate. The issue I'm seeing is with the metadframe.py module. Trying to run the module stand-alone, I see a recursion error while executing the example code under the

if __name__ == "__main__":
    meta_df = MetaDataFrame(abs(randn(3, 3)), index=['A', 'B', 'C'], columns=['c11', 'c22', 'c33'])`
    new = meta_df * 50.0`

Here's the error (part of it):

Traceback (most recent call last): File "/Users/XXXXX/Projects/pybcm_proj/pybcm/metadframe.py", line 395, in new = meta_df * 50.0 File "/Users/XXXXX/Projects/pybcm_proj/pybcm/metadframe.py", line 206, in mul return self._transfer(self._frame.mul(x)) File "/Users/XXXXX/virtualenvs/pybcm/lib/python3.6/copy.py", line 161, in deepcopy y = copier(memo) File "/Users/XXXXX/Projects/pybcm_proj/pybcm/metadframe.py", line 177, in _framegetattr dfout = self._transfer(out) ------------Many repeated lines of recursion here--------------- File "/Users/XXXXX/Projects/pybcm_proj/pybcm/metadframe.py", line 177, in _framegetattr dfout = self._transfer(out) File "/Users/XXXXX/Projects/pybcm_proj/pybcm/metadframe.py", line 140, in _transfer self) # This looks like None, but is it type (MetaPandasObject, just union prints None File "/Users/XXXXX/virtualenvs/pybcm/lib/python3.6/copy.py", line 161, in deepcopy y = copier(memo) File "/Users/XXXXX/Projects/pybcm_proj/pybcm/metadframe.py", line 173, in _framegetattr out = getattr(self._frame, attr)(*fcnargs, **fcnkwargs) File "/Users/XXXXX/virtualenvs/pybcm/lib/python3.6/site-packages/pandas/core/generic.py", line 3441, in deepcopy return self.copy(deep=True) File "/Users/XXXXX/virtualenvs/pybcm/lib/python3.6/site-packages/pandas/core/generic.py", line 3432, in copy data = self._data.copy(deep=deep) File "/Users/XXXXX/virtualenvs/pybcm/lib/python3.6/site-packages/pandas/core/internals.py", line 3432, in copy new_axes = [copy(ax) for ax in self.axes] File "/Users/XXXXX/virtualenvs/pybcm/lib/python3.6/site-packages/pandas/core/internals.py", line 3432, in new_axes = [copy(ax) for ax in self.axes] File "/Users/XXXXX/virtualenvs/pybcm/lib/python3.6/site-packages/pandas/core/internals.py", line 3431, in copy = lambda ax: ax.view() File "/Users/XXXXX/virtualenvs/pybcm/lib/python3.6/site-packages/pandas/core/indexes/base.py", line 712, in view result = self._shallow_copy() File "/Users/XXXXX/virtualenvs/pybcm/lib/python3.6/site-packages/pandas/core/indexes/base.py", line 410, in _shallow_copy return self._simple_new(values, **attributes) File "/Users/XXXXX/virtualenvs/pybcm/lib/python3.6/site-packages/pandas/core/indexes/base.py", line 387, in _simple_new for k, v in compat.iteritems(kwargs): RecursionError: maximum recursion depth exceeded

Any ideas how I can address this in py 3.6?

Geekly avatar Aug 23 '17 21:08 Geekly