File: test_loggingcalc.py

package info (click to toggle)
python-ase 3.22.1-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 14,344 kB
  • sloc: python: 126,379; xml: 946; makefile: 111; javascript: 47
file content (20 lines) | stat: -rw-r--r-- 551 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from ase.build import bulk
from ase.calculators.loggingcalc import LoggingCalculator
from ase.calculators.emt import EMT


def test_loggingcalc(tmp_path, figure):
    atoms = bulk('Au', orthorhombic=True)
    calc = LoggingCalculator(EMT())
    atoms.calc = calc

    for i in range(4):
        atoms.get_forces()
        atoms.get_potential_energy()
        atoms.positions[0, 0] += 0.1

    # This is kind of improper testing.
    # Should split plotting away from processing so we can
    # test the processing.
    calc.tabulate()
    calc.plot()