Skip to content

Commit

Permalink
Fix from_impact_template tests
Browse files Browse the repository at this point in the history
  • Loading branch information
martimunicoy committed Jun 9, 2021
1 parent 918b81f commit 0896d1c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
4 changes: 3 additions & 1 deletion peleffy/forcefield/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,8 @@ def reindex_atom_idx(list_params, dict_index):
with open(impact_template_path, 'r') as fd:
type_info = 'tag'
for line in fd.readlines():
if len(line.strip()) == 0: # Skip empty lines
continue
if not line.startswith('*'):
if 'NBON' in line:
type_info = 'nbon'
Expand Down Expand Up @@ -596,7 +598,7 @@ def reindex_atom_idx(list_params, dict_index):

# Impropers
impropers_list = []
for line in iphi[:-1]:
for line in iphi:
info = line.split()
case = {'atom1_idx': index(info[0]),
'atom2_idx': index(info[1]),
Expand Down
7 changes: 0 additions & 7 deletions peleffy/tests/test_parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,13 +290,6 @@ def test_generate_OPLS2005ParameterWrapper(molecule,
test_generate_OPLS2005ParameterWrapper(molecule,
impact_template_path)

# Test with molecule with phase different than 0 or 180
# Load molecule, parameterize and generate Impact template
molecule = Molecule(smiles='c1c(c(n(n1)S(=O)(=O)C))O')
impact_template_path = get_data_file_path('tests/unlz')
test_generate_OpenForceFieldParameterWrapper(molecule,
impact_template_path)

# The molecule and Impact template do no represent the same chemical
# entity
with pytest.raises(ValueError):
Expand Down

0 comments on commit 0896d1c

Please sign in to comment.