File: test_nsfd2o.py

package info (click to toggle)
python-periodictable 2.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,068 kB
  • sloc: python: 13,338; makefile: 103; sh: 92; javascript: 7
file content (17 lines) | stat: -rwxr-xr-x 575 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/env python

import periodictable

def test():
    # Regression test: make sure neutron sld is an isotope property
    # Note: it is important that this test be run separately
    D2O = periodictable.formula('D2O',density=20./18)
    D2O_coh,D2O_abs,D2O_inc = periodictable.neutron_sld(D2O)
    D2O_coh2,D2O_abs2,D2O_inc2 = periodictable.neutron_sld(D2O)
    H2O = periodictable.formula('H2O',density=1)
    H2O_coh,H2O_abs,H2O_inc = periodictable.neutron_sld(H2O)
    assert D2O_coh == D2O_coh2
    assert D2O_coh != H2O_coh

if __name__ == "__main__":
    test()