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

BUG: 'exclude' option does not work for 'order.nearest_neighbors' and 'order.k_nearest_neighbors' when 'other_coords' is specified #38

Open
aritra-mukhopadhyay opened this issue Jun 26, 2024 · 0 comments
Labels
bug Something isn't working module: order status: to do Issues that someone needs to work on

Comments

@aritra-mukhopadhyay
Copy link
Member

Description:

order.nearest_neighbors and order.k_nearest_neighbors counts the particle itself when counting its neighbors when other_coords is specified explicitly.

Code for reproduction:

import amep

traj = amep.load.traj('./examples/data/lammps')
frame = traj[-1]

# calculate nearest neighbours of particle id 2
nnn, distances, neighbors = amep.order.nearest_neighbors(
    frame.coords()[2, None], frame.box, other_coords=frame.coords(), exclude=True, pbc=True
)

#nnn, distances, neighbors = amep.order.k_nearest_neighbors(
#    frame.coords()[2, None], frame.box, other_coords=frame.coords(), pbc=True
#)

print(nnn) # number of nearest neighbors
print(distances) # nearest-neighbor distances
print(neighbors) # nearest neighbor ids

Error message:

No response

Python and AMEP versions:

Python 3.12.3
AMEP 1.0.1

Additional information:

No response

How did you install AMEP?

conda

@aritra-mukhopadhyay aritra-mukhopadhyay added bug Something isn't working status: to do Issues that someone needs to work on module: order labels Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working module: order status: to do Issues that someone needs to work on
Projects
None yet
Development

No branches or pull requests

1 participant