Currently, the nearest_neighbour method can result in a particle finding itself as its nearest neighbour when checking against another particle set that contains (some of) the same particles:
from amuse.ic.plummer import new_plummer_model
p = new_plummer_model(10)
q = p.copy()
r = q.nearest_neighbour(p)
print(r.key == p.key)
returns
[ True, True, True, True, True, True, True, True, True, True]
There should be an option (probably enabled by default) to ensure a particle with the same key is ignored.
Currently, the
nearest_neighbourmethod can result in a particle finding itself as its nearest neighbour when checking against another particle set that contains (some of) the same particles:returns
There should be an option (probably enabled by default) to ensure a particle with the same key is ignored.