diff --git a/docs/releasehistory.rst b/docs/releasehistory.rst index c848e5bb..4e990f68 100644 --- a/docs/releasehistory.rst +++ b/docs/releasehistory.rst @@ -15,10 +15,11 @@ This minor release integrates the parameterization of OBC charges and scale fact New features """""""""""" -- `PR #88 `_: New method to retrieve atom degrees with RDKit. - `PR #86 `_: New method to check the input PDB prior building the molecule. -- `PR #94 `_: New method for the OPLS OBC parameters. +- `PR #88 `_: New method to retrieve atom degrees with RDKit. +- `PR #90 `_: Add support for openff-1.3.0. - `PR #92 `_: New parameter to skip the stereochemistry assignment (and the checking from the OpenFF toolkit). +- `PR #94 `_: New method for the OPLS OBC parameters. - `PR #100 `_: New writer for the OPLS OBC parameters. - `PR #106 `_: New method to initialize a Molecule object directly from an RDKit and OpenFF molecular representations. - `PR #112 `_: New method to fix an input PDB file with no atomic element identifiers. @@ -37,8 +38,9 @@ Tests added """"""""""" - `PR #88 `_: Adds tests to validate the atom degrees getter. - `PR #86 `_: Adds tests to validate the PDB check up. -- `PR #94 `_: Adds tests to validate the OPLS OBC parameters generator. +- `PR #90 `_: General validation of supported force fields. - `PR #92 `_: New test to check the behaviour of the allow_undefined_stereo parameter. +- `PR #94 `_: Adds tests to validate the OPLS OBC parameters generator. - `PR #97 `_: Includes tests for the new Topology container class. - `PR #100 `_: Adds tests to validate the solvent template writers. - `PR #106 `_: Adds tests to check the RDKit and OpenFF molecular initializers. diff --git a/peleffy/forcefield/selectors.py b/peleffy/forcefield/selectors.py index e5d5afc1..c2c59f8a 100644 --- a/peleffy/forcefield/selectors.py +++ b/peleffy/forcefield/selectors.py @@ -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', diff --git a/peleffy/main.py b/peleffy/main.py index 6b9aee41..4d6994fb 100644 --- a/peleffy/main.py +++ b/peleffy/main.py @@ -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'] diff --git a/peleffy/tests/test_forcefields.py b/peleffy/tests/test_forcefields.py index 88cf4412..fbfe57dd 100644 --- a/peleffy/tests/test_forcefields.py +++ b/peleffy/tests/test_forcefields.py @@ -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' diff --git a/peleffy/tests/test_main.py b/peleffy/tests/test_main.py index ec3020b0..e6d8cfa3 100644 --- a/peleffy/tests/test_main.py +++ b/peleffy/tests/test_main.py @@ -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' @@ -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' @@ -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' @@ -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' @@ -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'