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 creating new molecule #164

Open
avirshup opened this issue Jun 13, 2017 · 0 comments
Open

Error creating new molecule #164

avirshup opened this issue Jun 13, 2017 · 0 comments

Comments

@avirshup
Copy link
Contributor

Bug report

Description

TypeError when copying atoms out of a molecule then creating a new one

Steps to reproduce

mol = mdt.from_smiles('[H][H]')
atoms = mol.atoms.copy()
atoms.append(mdt.Atom(1))
newmol = mdt.Molecule(atoms)

raises

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-11-52663920d8c4> in <module>()
      2 atoms = mol.atoms.copy()
      3 atoms.append(mdt.Atom(1))
----> 4 newmol = mdt.Molecule(atoms)

~/mycode/molecular-design-toolkit/moldesign/molecules/molecule.py in __init__(self, atomcontainer, name, bond_graph, copy_atoms, pdbname, charge, metadata)
   1058         self.chains = Instance(molecule=self)
   1059         self.residues = []
-> 1060         self._rebuild_topology(bond_graph=bond_graph)
   1061 
   1062         if name is not None:

~/mycode/molecular-design-toolkit/moldesign/molecules/molecule.py in _rebuild_topology(self, bond_graph)
    486         self.dim_masses = u.broadcast_to(self.masses, (3, self.num_atoms)).T
    487         self._assign_atom_indices()
--> 488         self._assign_residue_indices()
    489         self._dof = None
    490 

~/mycode/molecular-design-toolkit/moldesign/molecules/molecule.py in _assign_residue_indices(self)
    559 
    560         for atom in self.atoms:
--> 561             if last_pdb_idx is not None and atom.pdbindex <= last_pdb_idx:
    562                 atom.pdbindex = last_pdb_idx + 1
    563                 conflicts.add('atom numbers')

TypeError: unorderable types: NoneType() <= int()

Environment

  • Operating system: OS X High Sierra
  • python --version output: Python 3.5.2 :: Continuum Analytics, Inc.
  • pip show moldesign nbmolviz | grep -B1 Version output: 0.8.0a2
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

1 participant