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

error in CloseBipartitePairContainer when including pairs on same rigid body #998

Open
jtempkin opened this issue Nov 17, 2017 · 0 comments
Labels

Comments

@jtempkin
Copy link

jtempkin commented Nov 17, 2017

I ran into some strange behavior in CloseBipartitePairContainer when it includes pairs that are both contained in a single rigid body. When one tries to do this, the container only includes pairs formed between members of the first list and completely excludes any members from the second.

Here is a short script reproducing the error:

import IMP
import IMP.core
import IMP.atom


m = IMP.Model()

molA = IMP.atom.Molecule.setup_particle(m, IMP.Particle(m))
molB = IMP.atom.Molecule.setup_particle(m, IMP.Particle(m))

mols = [molA, molB]

for i, mol in enumerate(mols):

    p1 = IMP.core.XYZR.setup_particle(IMP.Particle(m))
    p2 = IMP.core.XYZR.setup_particle(IMP.Particle(m))

    p1.set_coordinates(IMP.algebra.Vector3D(i, i + 1, 0.0))
    p2.set_coordinates(IMP.algebra.Vector3D(i + 1, i + 1, 0.0))
    p1.set_radius(1.0)
    p2.set_radius(1.0)
    d1 = IMP.atom.Mass.setup_particle(m, p1, 1.0)
    d2 = IMP.atom.Mass.setup_particle(m, p2, 1.0)

    mol.add_child(d1)
    mol.add_child(d2)


rigid_mols = [IMP.atom.create_rigid_body(mol) for mol in mols]

list0 = [mol.get_child(0) for mol in mols]
list1 = [mol.get_child(1) for mol in mols]

lsc0 = IMP.container.ListSingletonContainer(m, list0)
lsc1 = IMP.container.ListSingletonContainer(m, list1)
bcp = IMP.container.CloseBipartitePairContainer(lsc0, lsc1, 5.0)

m.update()

print("Mol A:\n", lsc0.get_contents())
print("Mol B:\n", lsc1.get_contents())
print("Bipartitle container pairs:", bcp.get_contents())
@jtempkin jtempkin added the bug label Nov 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant