Example #1
0
def test_simple_other_units():
    unit_registry = SI_base_registry.copy()
    unit_registry['length'] = decimetre
    unit_registry['amount'] = umol
    integr, Cref, rd = with_units.main(unit_registry=unit_registry)
    Cout = integr.with_units('Cout')
    assert allclose(Cout[:, 0, :], Cref, atol=1e-6*molar)
Example #2
0
def test_simple(params):
    logy, logt = params
    integr, Cref, rd = with_units.main(logy=logy, logt=logt)
    Cout = integr.with_units('Cout')
    if logy or logt:
        assert allclose(Cout[:, 0, :], Cref, atol=2e-5*molar)
    else:
        assert allclose(Cout[:, 0, :], Cref, atol=1e-6*molar)