Merge pull request #690 from OpenFreeEnergy/tokenizable_atom_mappers

Tokenizable atom mappers
This commit is contained in:
Irfan Alibay
2024-01-25 16:50:24 +00:00
committed by GitHub
2 changed files with 22 additions and 0 deletions

View File

@@ -23,6 +23,17 @@ class TestAtomMapper:
def __init__(self, mappings):
self.mappings = mappings
@classmethod
def _defaults(cls):
return {}
def _to_dict(self):
return {'mappings': self.mappings}
@classmethod
def _from_dict(cls, dct):
return cls(**dct)
def _mappings_generator(self, componentA, componentB):
for mapping in self.mappings:
yield mapping.componentA_to_componentB

View File

@@ -10,6 +10,17 @@ from ..conftest import mol_from_smiles
class BadMapper(openfe.setup.atom_mapping.LigandAtomMapper):
@classmethod
def _defaults(cls):
return {}
def _to_dict(self):
return {}
@classmethod
def _from_dict(cls, d):
return cls()
def _mappings_generator(self, molA, molB):
yield {0: 0}