Skip to content

'nearest_neighbour' method should not return the same particle #978

@rieder

Description

@rieder

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: frameworkIssues related to the AMUSE framework: rfi, amusifier, MPI issueskind: feature requestThe issue requests a feature that AMUSE does not currently have

    Type

    No type

    Projects

    Status

    Feature Request

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions