Skip to content

Commit

Permalink
Merge pull request #90 from martimunicoy/support_openff-1.3.0
Browse files Browse the repository at this point in the history
Add support to openff 1.3.0
  • Loading branch information
martimunicoy committed Nov 28, 2020
2 parents cd10f2a + 3b5d364 commit b3db6ac
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 10 deletions.
8 changes: 5 additions & 3 deletions docs/releasehistory.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ This minor release integrates the parameterization of OBC charges and scale fact

New features
""""""""""""
- `PR #88 <https://github.com/martimunicoy/peleffy/pull/88>`_: New method to retrieve atom degrees with RDKit.
- `PR #86 <https://github.com/martimunicoy/peleffy/pull/86>`_: New method to check the input PDB prior building the molecule.
- `PR #94 <https://github.com/martimunicoy/peleffy/pull/94>`_: New method for the OPLS OBC parameters.
- `PR #88 <https://github.com/martimunicoy/peleffy/pull/88>`_: New method to retrieve atom degrees with RDKit.
- `PR #90 <https://github.com/martimunicoy/peleffy/pull/90>`_: Add support for openff-1.3.0.
- `PR #92 <https://github.com/martimunicoy/peleffy/pull/92>`_: New parameter to skip the stereochemistry assignment (and the checking from the OpenFF toolkit).
- `PR #94 <https://github.com/martimunicoy/peleffy/pull/94>`_: New method for the OPLS OBC parameters.
- `PR #100 <https://github.com/martimunicoy/peleffy/pull/100>`_: New writer for the OPLS OBC parameters.
- `PR #106 <https://github.com/martimunicoy/peleffy/pull/106>`_: New method to initialize a Molecule object directly from an RDKit and OpenFF molecular representations.
- `PR #112 <https://github.com/martimunicoy/peleffy/pull/112>`_: New method to fix an input PDB file with no atomic element identifiers.
Expand All @@ -37,8 +38,9 @@ Tests added
"""""""""""
- `PR #88 <https://github.com/martimunicoy/peleffy/pull/88>`_: Adds tests to validate the atom degrees getter.
- `PR #86 <https://github.com/martimunicoy/peleffy/pull/86>`_: Adds tests to validate the PDB check up.
- `PR #94 <https://github.com/martimunicoy/peleffy/pull/94>`_: Adds tests to validate the OPLS OBC parameters generator.
- `PR #90 <https://github.com/martimunicoy/peleffy/pull/90>`_: General validation of supported force fields.
- `PR #92 <https://github.com/martimunicoy/peleffy/pull/92>`_: New test to check the behaviour of the allow_undefined_stereo parameter.
- `PR #94 <https://github.com/martimunicoy/peleffy/pull/94>`_: Adds tests to validate the OPLS OBC parameters generator.
- `PR #97 <https://github.com/martimunicoy/peleffy/pull/97>`_: Includes tests for the new Topology container class.
- `PR #100 <https://github.com/martimunicoy/peleffy/pull/100>`_: Adds tests to validate the solvent template writers.
- `PR #106 <https://github.com/martimunicoy/peleffy/pull/106>`_: Adds tests to check the RDKit and OpenFF molecular initializers.
Expand Down
3 changes: 2 additions & 1 deletion peleffy/forcefield/selectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ class ForceFieldSelector(object):
It defines a force field selector.
"""
_FF_TYPES = {'OPLS2005': ('OPLS2005'),
'OpenFF': ('openff_unconstrained-1.2.1.offxml',
'OpenFF': ('openff_unconstrained-1.3.0.offxml',
'openff_unconstrained-1.2.1.offxml',
'openff_unconstrained-1.2.0.offxml',
'openff_unconstrained-1.1.1.offxml',
'openff_unconstrained-1.1.0.offxml',
Expand Down
2 changes: 1 addition & 1 deletion peleffy/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from peleffy.utils import Logger, OutputPathHandler


DEFAULT_OFF_FORCEFIELD = 'openff_unconstrained-1.2.1.offxml'
DEFAULT_OFF_FORCEFIELD = 'openff_unconstrained-1.3.0.offxml'
DEFAULT_RESOLUTION = int(30)
DEFAULT_CHARGE_METHOD = 'am1bcc'
AVAILABLE_CHARGE_METHODS = ['am1bcc', 'gasteiger', 'OPLS']
Expand Down
55 changes: 55 additions & 0 deletions peleffy/tests/test_forcefields.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,3 +397,58 @@ def check(hybridff, molecule, ffld_file, reference_file):
check(hybridff, molecule, ffld_file,
get_data_file_path(
'tests/ETL_openff-1.2.1_opls2005_parameters2.json'))


class TestForceFieldSelector(object):
"""
It wraps all tests that check the force field selector class.
"""

def test_get_by_name(self):
"""It checks the get_by_name method."""

from peleffy.forcefield import ForceFieldSelector
from peleffy.forcefield import OpenForceField
from peleffy.forcefield import OPLS2005ForceField

selector = ForceFieldSelector()

forcefield = selector.get_by_name('openff_unconstrained-1.0.0.offxml')

assert isinstance(forcefield, OpenForceField), \
'Unexpected force field type'

forcefield = selector.get_by_name('openff_unconstrained-1.0.1.offxml')

assert isinstance(forcefield, OpenForceField), \
'Unexpected force field type'

forcefield = selector.get_by_name('openff_unconstrained-1.1.0.offxml')

assert isinstance(forcefield, OpenForceField), \
'Unexpected force field type'

forcefield = selector.get_by_name('openff_unconstrained-1.1.1.offxml')

assert isinstance(forcefield, OpenForceField), \
'Unexpected force field type'

forcefield = selector.get_by_name('openff_unconstrained-1.2.0.offxml')

assert isinstance(forcefield, OpenForceField), \
'Unexpected force field type'

forcefield = selector.get_by_name('openff_unconstrained-1.2.1.offxml')

assert isinstance(forcefield, OpenForceField), \
'Unexpected force field type'

forcefield = selector.get_by_name('openff_unconstrained-1.3.0.offxml')

assert isinstance(forcefield, OpenForceField), \
'Unexpected force field type'

forcefield = selector.get_by_name('OPLS2005')

assert isinstance(forcefield, OPLS2005ForceField), \
'Unexpected force field type'
10 changes: 5 additions & 5 deletions peleffy/tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def test_peleffy_argparse(self):
'Unexpected charge_method settings were parsed'
assert parsed_args.debug is False, \
'Unexpected debug settings were parsed'
assert parsed_args.forcefield == 'openff_unconstrained-1.2.1.offxml', \
assert parsed_args.forcefield == 'openff_unconstrained-1.3.0.offxml', \
'Unexpected forcefield settings were parsed'
assert parsed_args.include_terminal_rotamers is False, \
'Unexpected include_terminal_rotamers settings were parsed'
Expand Down Expand Up @@ -156,7 +156,7 @@ def test_peleffy_argparse(self):
'Unexpected charge_method settings were parsed'
assert parsed_args.debug is False, \
'Unexpected debug settings were parsed'
assert parsed_args.forcefield == 'openff_unconstrained-1.2.1.offxml', \
assert parsed_args.forcefield == 'openff_unconstrained-1.3.0.offxml', \
'Unexpected forcefield settings were parsed'
assert parsed_args.include_terminal_rotamers is False, \
'Unexpected include_terminal_rotamers settings were parsed'
Expand All @@ -181,7 +181,7 @@ def test_peleffy_argparse(self):
'Unexpected charge_method settings were parsed'
assert parsed_args.debug is False, \
'Unexpected debug settings were parsed'
assert parsed_args.forcefield == 'openff_unconstrained-1.2.1.offxml', \
assert parsed_args.forcefield == 'openff_unconstrained-1.3.0.offxml', \
'Unexpected forcefield settings were parsed'
assert parsed_args.include_terminal_rotamers is True, \
'Unexpected include_terminal_rotamers settings were parsed'
Expand All @@ -206,7 +206,7 @@ def test_peleffy_argparse(self):
'Unexpected charge_method settings were parsed'
assert parsed_args.debug is False, \
'Unexpected debug settings were parsed'
assert parsed_args.forcefield == 'openff_unconstrained-1.2.1.offxml', \
assert parsed_args.forcefield == 'openff_unconstrained-1.3.0.offxml', \
'Unexpected forcefield settings were parsed'
assert parsed_args.include_terminal_rotamers is False, \
'Unexpected include_terminal_rotamers settings were parsed'
Expand Down Expand Up @@ -234,7 +234,7 @@ def test_peleffy_argparse(self):
'Unexpected charge_method settings were parsed'
assert parsed_args.debug is True, \
'Unexpected debug settings were parsed'
assert parsed_args.forcefield == 'openff_unconstrained-1.2.1.offxml', \
assert parsed_args.forcefield == 'openff_unconstrained-1.3.0.offxml', \
'Unexpected forcefield settings were parsed'
assert parsed_args.include_terminal_rotamers is False, \
'Unexpected include_terminal_rotamers settings were parsed'
Expand Down

0 comments on commit b3db6ac

Please sign in to comment.