Open clbarnes opened 5 years ago
Very tangentially related thing that might be useful for debugging if you stick with a petgraph-based tree lib: plotting petgraphs in jupyter
Ah, yeah, that could be handy.
I'm considering rescoping this attempt to just manage morphology-related stuff for now - dict lookups could be quicker in python, so traversal based on them isn't a great idea, which becomes a problem for looking at large numbers of skeletons. Immutable graph which gets cloned for rerooting, pruning etc. Remains to be seen whether the overhead of converting into a rust data structure would be made back from the algorithm speed, but i suspect it would.
Adding to the pile:
I'm leaning towards slab-tree. It has stable indices through both insertions and deletions (essential for e.g. caching branch points), it's safe, and has good traversal options. However, it's not widely used, and can't store edge weights.
These mainly require knowing the tree structure before you build it (i.e. not from a bag of edges), so I'll probably need to keep some of the hashmap-based algorithms anyway just to build it.
At a minimum, we'd need to store:
Then we could additionally cache:
I think these could all be initialised on construction at little CPU cost if we're willing to spare the memory.
For possible improved performance, memory size, safety, readability.
Some results for "tree" on cargo:
Wants