File: test_ptable.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 (17 lines) | stat: -rw-r--r-- 480 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/env python3
# fmt: off
"""Test Periodic Table."""
from ase.utils.ptable import ptable

spacing = 1.0


def test_pourbaix():
    """Test the periodic table generating function."""
    atoms = ptable(spacing)
    x = atoms.positions[:, 0]
    # testing to ensure that the table is 18 groups wide
    assert spacing * 17 == (x.max() - x.min())
    # testing that there are 118 unique elements
    symbols = set(atoms.get_chemical_symbols())
    assert len(symbols) == 118