How to use the hepunits.units.GeV function in hepunits

To help you get started, we’ve selected a few hepunits examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github scikit-hep / scikit-hep / tests / math / test_kinematics.py View on Github external
def test_width_lifetime_conversions():
    assert lifetime_to_width(1.5*ps)/GeV == approx(4.388079676311604e-13)
    assert 1.5*ps * lifetime_to_width(1.5*ps) == hbar
    assert width_to_lifetime(hbar) == 1 * MeV
    #
    with pytest.raises(ValueError):
        lifetime_to_width(-1)
    with pytest.raises(ValueError):
        width_to_lifetime(-1)

hepunits

Units and constants in the HEP system of units

BSD-3-Clause
Latest version published 2 months ago

Package Health Score

70 / 100
Full package analysis

Similar packages