File: conftest.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 (27 lines) | stat: -rw-r--r-- 634 bytes parent folder | download | duplicates (2)
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
import pytest
import numpy as np
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)