Skip to content

Commit

Permalink
Fix FF Accessors (cherry-picked from QM/MM branch)
Browse files Browse the repository at this point in the history
  • Loading branch information
avirshup committed Feb 28, 2017
1 parent 236ce72 commit 97c1cfd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion moldesign/molecules/atoms.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ def ff(self):
""" moldesign.utils.DotDict: This atom's force field parameters, if available (``None``
otherwise)
"""
return self.molecule.ff.get_atom_terms(self)
if self.molecule.ff is None:
return None
else:
return self.molecule.ff.get_atom_terms(self)

@property
def basis_functions(self):
Expand Down
6 changes: 3 additions & 3 deletions moldesign/molecules/notebook_display.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,12 @@ def markdown_summary(self):
lines.append('**Basis functions:**<br>' + '<br>'.join(map(str,self.basis_functions)))

if self.ff:
lines.append('**Forcefield partial charge**: %s' % self.ff.partialcharge)
lines.append('\n**Forcefield partial charge**: %s' % self.ff.partial_charge)
# TODO: deal with other LJ types, e.g., AB?
lines.append(u'**Forcefield LJ params**: '
u'\u03C3=%s, \u03B5=%s' % (
self.ff.lj.sigma.defunits(),
self.ff.lj.epsilon.defunits()))
self.ff.ljsigma.defunits(),
self.ff.ljepsilon.defunits()))

# position and momentum
table = utils.MarkdownTable('', 'x', 'y', 'z')
Expand Down

0 comments on commit 97c1cfd

Please sign in to comment.