Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: delay graph generation for skeletons #132

Merged
merged 1 commit into from
Apr 7, 2024

Conversation

schlegelp
Copy link
Collaborator

@schlegelp schlegelp commented Nov 14, 2023

The classify_nodes function is called at TreeNeuron initialisation. In master, this function uses the igraph (or networkx) representation of the neuron. Generating the graph for a skeleton comes at a sizeable overhead but it will be cached for future use.

This PR re-implements the classify_nodes function using pure pandas. It's overall as fast as the current graph-based function minus the overhead for the construction of the graph. In my hands this speeds up import of skeletons by 5-6X.

Many workflows (e.g. making dotprops from skeletons) do not need the graph representation, so being able to skip it is advantageous. For workflows that do need the graph, we simply delay its generation but shouldn't loose performance.

Thoughts @clbarnes?

@clbarnes
Copy link
Collaborator

Looks good to me!

@schlegelp schlegelp merged commit 925ee70 into master Apr 7, 2024
24 of 25 checks passed
@schlegelp schlegelp deleted the skeleton_delayed_graph branch April 7, 2024 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants