Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion intermol/forces/forcefunctions.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,10 @@ def create_kwds_from_entries(unitvars, paramlist, entries, force_type, offset=0)
u = unitvars[typename]
params = paramlist[typename]
for i, p in enumerate(params):
kwds[p] = float(entries[offset+i]) * u[i]
if len(entries) <= (offset+i):
kwds[p] = 0.0 * u[i]
else:
kwds[p] = float(entries[offset+i]) * u[i]
return kwds


Expand Down
3 changes: 3 additions & 0 deletions intermol/lammps/lammps_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ def canonical_dihedral(self, params, dihedral, direction='into'):
elif dihedral == FourierDihedral:
convertfunc = convert_dihedral_from_fourier_to_trig
converted_dihedral = TrigDihedral
elif dihedral == TrigDihedral:
convertfunc = lambda x: x

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you either remove the converted_dihedral = dihedral # Default line above or move the convertfunc to the top as the base case and delete this branch?

converted_dihedral = TrigDihedral
# Now actually convert the dihedral.
params = convertfunc(params)

Expand Down