Beispiel #1
0
def test_get_density(temps, exp_value, use_out):
    if use_out:
        out = np.zeros_like(temps)
        get_density(oil_, temps, out)
    else:
        out = get_density(oil_, temps)
    assert np.all(out == exp_value)  # so it works for scalar + arrays
def test_get_density(temps, exp_value, use_out):
    if use_out:
        out = np.zeros_like(temps)
        get_density(oil_, temps, out)
    else:
        out = get_density(oil_, temps)
    assert np.all(out == exp_value)   # so it works for scalar + arrays
Beispiel #3
0
def test_OilProps_sample_oil(oil, density, units):
    """ compare expected values with values stored in OilProps - make sure
    data entered correctly and unit conversion is correct """

    o = get_oil_props(oil)
    d = uc.convert('density', units, 'kg/m^3', density)

    assert o.name == oil
    assert np.isclose(get_density(o, 273.15 + 15), d)
Beispiel #4
0
def test_OilProps_sample_oil(oil, density, units):
    """ compare expected values with values stored in OilProps - make sure
    data entered correctly and unit conversion is correct """

    o = get_oil_props(oil)
    d = uc.convert('density', units, 'kg/m^3', density)

    assert o.name == oil
    assert np.isclose(get_density(o, 273.15 + 15), d)