rrcf icon indicating copy to clipboard operation
rrcf copied to clipboard

to_dict() on an empty tree fails

Open TrigonaMinima opened this issue 3 years ago • 0 comments

While saving an empty tree TypeError is raised. Here's the code:

import rrcf
a = rrcf.RCTree()
a.to_dict()

and the stack trace:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/anaconda3/lib/python3.7/site-packages/rrcf/rrcf.py", line 748, in to_dict
    self._serialize(self.root, obj, duplicates)
  File "/anaconda3/lib/python3.7/site-packages/rrcf/rrcf.py", line 780, in _serialize
    raise TypeError('`node` must be Branch or Leaf instance')
TypeError: `node` must be Branch or Leaf instance

TrigonaMinima avatar Nov 27 '20 12:11 TrigonaMinima