'Check various LogUnit subclasses are equivalent and convertible
to their non-log counterparts.'

@pytest.mark.parametrize(u'lu_unit,    physical_unit', itertools.product(lu_units, pu_sample))
def test_physical_unit_conversion(self, lu_unit, physical_unit):

    lu1 = lu_unit(physical_unit)
    assert lu1.is_equivalent(physical_unit)
    assert (lu1.to(physical_unit, 0.0) == 1.0)
    assert physical_unit.is_equivalent(lu1)
    assert (physical_unit.to(lu1, 1.0) == 0.0)
    pu = u.Unit((8.0 * physical_unit))
    assert lu1.is_equivalent(physical_unit)
    assert (lu1.to(pu, 0.0) == 0.125)
    assert pu.is_equivalent(lu1)
    assert_allclose(pu.to(lu1, 0.125), 0.0, atol=1e-15)
    value = np.linspace(0.0, 10.0, 6)
    assert_allclose(pu.to(lu1, lu1.to(pu, value)), value, atol=1e-15)
    pu2 = u.g
    assert (not lu1.is_equivalent(pu2))
    with pytest.raises(u.UnitsError):
        lu1.to(pu2)
    assert (not pu2.is_equivalent(lu1))
    with pytest.raises(u.UnitsError):
        pu2.to(lu1)
