File: test_units.py

package info (click to toggle)
python-dynasor 2.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 22,008 kB
  • sloc: python: 5,263; sh: 20; makefile: 3
file content (14 lines) | stat: -rw-r--r-- 540 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import numpy as np

from dynasor.units import radians_per_fs_to_THz, radians_per_fs_to_meV, radians_per_fs_to_invcm
from dynasor.units import THz_to_meV, THz_to_invcm, meV_to_invcm


def test_units():

    assert np.isclose(THz_to_meV, 4.13567)
    assert np.isclose(THz_to_meV * meV_to_invcm, THz_to_invcm)

    assert np.isclose(radians_per_fs_to_THz, 1000 / (2 * np.pi))
    assert np.isclose(radians_per_fs_to_THz * THz_to_meV, radians_per_fs_to_meV)
    assert np.isclose(radians_per_fs_to_THz * THz_to_invcm, radians_per_fs_to_invcm)