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

Update snap_molecule_indices or use function from cmeutils? #33

Open
JimmyRushing opened this issue Dec 1, 2021 · 1 comment
Open

Comments

@JimmyRushing
Copy link
Collaborator

JimmyRushing commented Dec 1, 2021

n_query_pts = n_pts = snap.bonds.N

I changed this code to the code below to deal with an indexing artifact of how the xml was converted to gsd . Is this worth updating in morph? Or is this redundant with this cmeutils PR cmelab/cmeutils#20

    system = freud.AABBQuery.from_system(snap)
    bonds = snap.bonds.group
    bonds = bonds[np.lexsort((bonds[:,1],bonds[:,0]))]
    snap.bonds.group = bonds
    n_query_pts = n_pts = snap.bonds.N
    query_pt_inds = snap.bonds.group[:,0]
    pt_inds = snap.bonds.group[:, 1]
    distances = system.box.compute_distances(
        system.points[query_pt_inds], system.points[pt_inds]
    )
    nlist = freud.NeighborList.from_arrays(
        n_query_pts, n_pts, query_pt_inds, pt_inds, distances
    )
    cluster = freud.cluster.Cluster()
    cluster.compute(system=system, neighbors=nlist)
    return cluster.cluster_idx
@jennyfothergill
Copy link
Member

jennyfothergill commented Jan 25, 2022

If we switch to using snap_molecule_indices from cmeutils, then yes. Probably that should be done.

@jennyfothergill jennyfothergill changed the title Should this be changed? Update snap_molecule_indices or use function from cmeutils? Jan 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants