Skip to content

Commit

Permalink
Automatic Sync from SCM-svn to GitHub
Browse files Browse the repository at this point in the history
syncing the following commits:
MattiHellstrom: add extract_engine_settings method to PLAMS SCMSUITE-- SO--
  • Loading branch information
scmtestadf committed Dec 30, 2023
1 parent cae1ec3 commit 023d7e7
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions interfaces/adfsuite/ams.py
Original file line number Diff line number Diff line change
Expand Up @@ -2542,6 +2542,27 @@ def _add_region(atom:Atom, name:str):
atom.properties.region.add(name)


def extract_engine_settings(settings: Settings) -> Settings:
"""
Extracts the engine setttings from a Settings object.
Example:
s.input.ams.Task = "singlepoint"
s.runscript.nproc = 1
s.input.ForceField.Type = "UFF"
extract_engine_settings(s) will return Settings with s.input.ForceField.Type = "UFF"
"""

ret = Settings()

if "input" in settings:
for e in settings.input:
if e != "ams":
ret.input[e] = settings.input[e].copy()
break

return ret

def hybrid_committee_engine_settings(settings_list: List[Settings]) -> Settings:
"""
Creates the Settings for an AMS Hybrid engine that takes the average of all subengines as the prediction (for energies and forces).
Expand Down

0 comments on commit 023d7e7

Please sign in to comment.