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

SmallMol issue with writing multiple frames #46

Open
stefdoerr opened this issue Apr 6, 2020 · 0 comments
Open

SmallMol issue with writing multiple frames #46

stefdoerr opened this issue Apr 6, 2020 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@stefdoerr
Copy link
Contributor

from moleculekit.smallmol.smallmol import SmallMol
sm = SmallMol('CCOO')
sm.generateConformers(10)
for i in range(10):
  sm.write(f'/tmp/stefan{i}.pdb', frames=i)

crashes with

NameError                                 Traceback (most recent call last)
<ipython-input-17-aeef6cceb0cb> in <module>
      1 for i in range(10):
----> 2     sm.write(f'/tmp/stefan{i}.pdb', frames=[i,])
      3 

~/Work/moleculekit/moleculekit/smallmol/smallmol.py in write(self, fname, frames, merge)
    601         else:
    602             mol = self.toMolecule()
--> 603             mol.write(fname, frames)
    604 
    605     def view(self, *args, **kwargs):

~/Work/moleculekit/moleculekit/molecule.py in write(self, filename, sel, type, **kwargs)
   1309         if not (sel is None or (isinstance(sel, str) and sel == "all")):
   1310             src = self.copy()
-> 1311             src.filter(sel, _logger=False)
   1312 
   1313         if type in _WRITERS:

~/Work/moleculekit/moleculekit/molecule.py in filter(self, sel, _logger)
    784 
    785         if not isinstance(s, np.ndarray) or s.dtype != bool:
--> 786             raise NameError("Filter can only work with string inputs or boolean arrays")
    787         return self.remove(np.invert(s), _logger=_logger)
    788 

NameError: Filter can only work with string inputs or boolean arrays
@stefdoerr stefdoerr self-assigned this Apr 6, 2020
@stefdoerr stefdoerr added the bug Something isn't working label Apr 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant