Refactor of SWC Reader.#660
Conversation
|
btw, have you ever tried igraph? Switching to it from |
|
We cannot rely on |
|
ah, did not know about that. now I need to change the licenses of mines.. :-) |
michaeldeistler
left a comment
There was a problem hiding this comment.
Hi @jnsbck,
I started reviewing this but I am really confused---why is all code in tmp.py? Why are zero lines removed? I think there is some stuff missing. Please add it and request another review. Thanks!
michaeldeistler
left a comment
There was a problem hiding this comment.
Overall this looks awesome, I love how short and fast it is.
A few things:
- Let's make sure that graphs are always named explicitly (I see you already do this in later parts of the code of dev.ipynb, but let's also do it consistently in all python modules). I am not a fan of something like:
G = swc_to_nx("../jaxley/tests/swc_files/morph_interrupted_soma.swc")
G = compartmentalize(G, ncomp=1)and I would prefer
swc_graph = swc_to_nx("../jaxley/tests/swc_files/morph_interrupted_soma.swc")
comp_graph = compartmentalize(swc_graph, ncomp=1)-
I actually get much larger speedups than you :) Between 3x and 15x.
-
You rename quite some functions, e.g.
swc_to_nx,compartmentalize. I don't think I have strong opinions, but let's carefully think about naming if we want to change them (again). -
Let's have as many code comments on what is happening as possible. I find these parts of the toolbox to be very difficult to follow purely based on code (in part because I do not know nx very well).
-
Before making things "nice", I would recommend you to test whether all SWC tests pass (if you have not done so yet).
|
Thanks for the feedback! Happy to hear you like it.
|
…andling [skip ci]
…now matching the current reader
…g and putting it all together
…o same error [skip ci].
I refactored the existing SWC reader integrating all the learnings from the past iterations. It is much more concise now. Also runs up to 2x faster.
It should also be much clearer now what is happening. The steps are still the same, i.e. trace branches, compartmentalize, add jaxley metadata, create solve_graph, build module, but there is less util code now.
Imported modules appear to match the old ones.
Todos:
to_graphequivI have not started integrating it yet and kept it seperate for now. Feedback is greatly appreciated.