diff --git a/src/openfe/protocols/openmm_rfe/hybridtop_protocols.py b/src/openfe/protocols/openmm_rfe/hybridtop_protocols.py index ed83e0459..462524337 100644 --- a/src/openfe/protocols/openmm_rfe/hybridtop_protocols.py +++ b/src/openfe/protocols/openmm_rfe/hybridtop_protocols.py @@ -272,8 +272,6 @@ def _validate_mapping( ValueError * If there are more than one mapping or mapping is None * If the mapping components are not in the alchemical components. - UserWarning - * Mappings which involve element changes in core atoms """ # if a single mapping is provided, convert to list if isinstance(mapping, ComponentMapping): @@ -294,26 +292,6 @@ def _validate_mapping( f"in alchemical components of state{state}" ) - # TODO: remove - this is now the default behaviour? - # Check for element changes in mappings - for m in mapping: - molA = m.componentA.to_rdkit() - molB = m.componentB.to_rdkit() - for i, j in m.componentA_to_componentB.items(): - atomA = molA.GetAtomWithIdx(i) - atomB = molB.GetAtomWithIdx(j) - if atomA.GetAtomicNum() != atomB.GetAtomicNum(): - wmsg = ( - f"Element change in mapping between atoms " - f"Ligand A: {i} (element {atomA.GetAtomicNum()}) and " - f"Ligand B: {j} (element {atomB.GetAtomicNum()})\n" - "No mass scaling is attempted in the hybrid topology, " - "the average mass of the two atoms will be used in the " - "simulation" - ) - logger.warning(wmsg) - warnings.warn(wmsg) - @staticmethod def _validate_smcs( stateA: ChemicalSystem, diff --git a/src/openfe/tests/protocols/openmm_rfe/test_hybrid_top_validation.py b/src/openfe/tests/protocols/openmm_rfe/test_hybrid_top_validation.py index 6d5db1249..7f47c1d80 100644 --- a/src/openfe/tests/protocols/openmm_rfe/test_hybrid_top_validation.py +++ b/src/openfe/tests/protocols/openmm_rfe/test_hybrid_top_validation.py @@ -1,6 +1,7 @@ # This code is part of OpenFE and is licensed under the MIT license. # For details, see https://github.com/OpenFreeEnergy/openfe import logging +import warnings import pytest from openff.units import unit as offunit @@ -357,7 +358,8 @@ def test_too_many_prot_comps_error( def test_element_change_warning(atom_mapping_basic_test_files): - # check a mapping with element change gets rejected early + # in openfe