File: conftest.py

package info (click to toggle)
python-ase 3.26.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 15,484 kB
  • sloc: python: 148,112; xml: 2,728; makefile: 110; javascript: 47
file content (29 lines) | stat: -rw-r--r-- 650 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# fmt: off
import numpy as np
import pytest

from ase import Atoms


@pytest.fixture()
def lammpsdata_file_path(datadir):
    return datadir / 'lammpsdata_input.data'


@pytest.fixture()
def atoms():
    # Some constants used to initialize things
    CELL_LENGTH = 102.3776
    NATOMS = 3
    MAX_VEL = 0.1

    atoms_attrs = {
        'cell': [CELL_LENGTH] * 3,
        'positions': np.random.RandomState(17).rand(NATOMS, 3) * CELL_LENGTH,
        'charges': [0.0] * NATOMS,
        'velocities': np.random.RandomState(41).rand(NATOMS, 3) * MAX_VEL,
        'numbers': [1] * NATOMS,
        'pbc': [True] * 3,
    }

    return Atoms(**atoms_attrs)