question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Hi, I have found a problem in pickling and unpickling the trees. After following through the original streaming example I tried pickling and unpickling a single tree, but the results are not same.

t = forest[0]
with open("a.pkl", "wb") as f:
    pickle.dump(t.to_dict(), f)

t2 = rrcf.RCTree()
with open("a.pkl", "rb") as f:
    t2.load_dict(pickle.load(f))

len(t.leaves)
# 257

len(t2.leaves)
# 238

I thought the issue is while calling pickle.dump as the tree dict is nested, but the documentation says it’ll raise RecursionError if such an object is encountered. So I think the issue could be with the to_dict or load_dict functions. I used both pickle and dill to test this.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mdbartoscommented, May 21, 2020

Greetings, this should now be addressed in #74

0reactions
mdbartoscommented, May 21, 2020

I’ve confirmed that this is an issue related to duplicate points. Moreover, it only seems to be a problem with the leaves dict–the tree structure itself appears to be ok.

The problem is on lines 816-817 of rrcf.py. to_dict may need to be rewritten to keep track of all the original indices for a given duplicated point.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting common problems with home canned pickles
If you experience problems with hollow pickles, the most common cause is too much time between gathering and pickling. · Another cause is...
Read more >
Common Pickle Problems | Home & Garden Information Center
Hollow pickles · Faulty growth of cucumber. None. During washing, hollow cucumbers usually float. Remove and use for relish. ; Shriveled pickles ......
Read more >
Causes and Possible Solutions for Problems with Pickled Foods
Shriveled Pickles, 1. Placing cucumbers in too strong brine, too heavy syrup, or too strong vinegar. 1. Follow a reliable recipe. Use amounts...
Read more >
COMMON PICKLE PROBLEMS - UC ANR
Remove scum as often as needed. Dark or discolored pickles (if brass, copper or zinc utensils were used do not use the pickles)...
Read more >
Fermented Pickle Problems: Causes and Possible Solutions
Fermented Pickle Problems: Causes and Possible Solutions ; 3. Insufficient amount of brine. 3. Keep cucumbers immersed in the brine. ; 4. Pickles...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found