Skip to content

Commit

Permalink
Merge pull request #690 from OpenFreeEnergy/tokenizable_atom_mappers
Browse files Browse the repository at this point in the history
Tokenizable atom mappers
  • Loading branch information
IAlibay authored Jan 25, 2024
2 parents b7224f4 + 443fcf2 commit 8e3fecb
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
11 changes: 11 additions & 0 deletions openfe/tests/setup/atom_mapping/test_atommapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@ class ConcreteLigandAtomMapper(LigandAtomMapper):
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
Expand Down
11 changes: 11 additions & 0 deletions openfe/tests/setup/test_network_planning.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@


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}

Expand Down

0 comments on commit 8e3fecb

Please sign in to comment.