jaxleyverse / jaxley

Differentiable neuron simulations with biophysical detail on CPU, GPU, or TPU.
https://jaxley.readthedocs.io
Apache License 2.0
59 stars 9 forks source link

New `distance` #451

Open jnsbck opened 1 month ago

jnsbck commented 1 month ago

In line with connect I think it might be sensible to move distance out of CompView and to somewhere else such that the following works.

comp1 = jx.Comp()
comp2 = jx.Comp()

distance(comp1,comp2)

Could also assert that they are part of the same Module of course still, i.e. with is_same_network. Also distance should be able to not just compute a distance for a single comp, but also between N <-> N, 1 <-> N or N <-> 1 compartments and return a vector.

EDIT: should be trivial if #447 is merged, since cell.branch(0).comp(0).xyzr works.

jnsbck commented 2 days ago

Hey @manuelgloeckler are you still working on this or do you need any help? Would be happy to collab on this as well (incl the graph stuff). Lemme know.