Skip to content

Commit

Permalink
drop general forcefield (#512)
Browse files Browse the repository at this point in the history
* drop general forcefield

* update atomclass for all atomtypes in oplsaa.xml, also update changelog

* fix unit tests

* fix typo in changelog

* fix more typo

* revert changes to the oplsaa.xml due to unforsee complecation
  • Loading branch information
daico007 authored Aug 26, 2022
1 parent 999894b commit 3194bbc
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1,154 deletions.
8 changes: 3 additions & 5 deletions foyer/atomtyper.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ def find_atomtypes(structure, forcefield, max_iter=10):
----------
structure : parmed.Structure, or gmso.Topology, or TopologyGraph
The topology that we are trying to atomtype. If a parmed.Structure or
gmso.Topology is provided, it will be convert to a TopologyGraph before
gmso.Topology is provided, it will be converted to a TopologyGraph before
atomtyping.
forcefield : AtomTypingRulesProvider, foyer.ForceField, foyer.general_forcefield.Forcefield
forcefield : AtomTypingRulesProvider, foyer.ForceField
The atomtyping rules provider object/foyer forcefield.
max_iter : int, optional, default=10
The maximum number of iterations.
Expand All @@ -69,7 +69,6 @@ def find_atomtypes(structure, forcefield, max_iter=10):
# for a less painful conversion process

from foyer.forcefield import Forcefield
from foyer.general_forcefield import Forcefield as GeneralForcefield

topology_graph = structure

Expand All @@ -78,8 +77,7 @@ def find_atomtypes(structure, forcefield, max_iter=10):
elif isinstance(structure, Topology):
topology_graph = TopologyGraph.from_gmso_topology(structure)

if isinstance(forcefield, (Forcefield, GeneralForcefield)):
forcefield = AtomTypingRulesProvider.from_foyer_forcefield(forcefield)
forcefield = AtomTypingRulesProvider.from_foyer_forcefield(forcefield)

typemap = {
atom_index: {"whitelist": set(), "blacklist": set(), "atomtype": None}
Expand Down
4 changes: 4 additions & 0 deletions foyer/forcefields/xml/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ v0.0.2 - June 24, 2021
v0.0.3 - August 7, 2021
- update SMARTS string for opls_154 (from `[O;X2]H` to `[O;X2](H)([!H])`)


xml.write("oplsaa.xml")
```
----
## Trappe-UA
Expand Down
Loading

0 comments on commit 3194bbc

Please sign in to comment.