File: test_filter.py

package info (click to toggle)
python-ase 3.21.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 13,936 kB
  • sloc: python: 122,428; xml: 946; makefile: 111; javascript: 47
file content (15 lines) | stat: -rw-r--r-- 466 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from ase.build import molecule
from ase.constraints import Filter
from ase.optimize import QuasiNewton
from ase.calculators.emt import EMT

def test_filter():
    """Test that the filter and trajectories are playing well together."""

    atoms = molecule('CO2')
    atoms.calc = EMT()
    filter = Filter(atoms, indices=[1, 2])

    with QuasiNewton(filter, trajectory='filter-test.traj', logfile='filter-test.log') as opt:
        opt.run()
    # No assertions=??