Skip to content

Commit

Permalink
ase plugin: add doc for virial sources
Browse files Browse the repository at this point in the history
  • Loading branch information
link89 committed May 19, 2024
1 parent 42e31bf commit 2867039
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions dpdata/plugins/ase.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ def from_labeled_system(self, atoms: ase.Atoms, **kwargs) -> dict:
RuntimeError
ASE will raise RuntimeError if the atoms does not
have a calculator
Note that this method will try to load virials from the following sources:
- atoms.info['virial']
- atoms.info['virials']
- converted from stress tensor
"""
from ase.calculators.calculator import PropertyNotImplementedError

Expand Down Expand Up @@ -167,13 +173,7 @@ def to_system(self, data, **kwargs):
return structures

def to_labeled_system(self, data, *args, **kwargs):
"""Convert System to ASE Atoms object.
Note that this method will try to load virials from the following sources:
- atoms.info['virial']
- atoms.info['virials']
- converted from stress tensor
"""
"""Convert System to ASE Atoms object. """
from ase import Atoms
from ase.calculators.singlepoint import SinglePointCalculator

Expand Down

0 comments on commit 2867039

Please sign in to comment.