def test_normalize_emptypc(): """Test that we can normalize both when pc is missing, and when it is all zero""" wateroil = WaterOil() pc_fn = normalize_pc(wateroil) assert np.isclose(pc_fn(0), 0) assert np.isclose(pc_fn(1), 0) wateroil = WaterOil(swl=0.01) wateroil.add_simple_J(g=0) pc_fn = normalize_pc(wateroil) assert np.isclose(pc_fn(0), 0) assert np.isclose(pc_fn(1), 0)
def test_normalize_pc(swirr, dswl): """Test that we can normalize a pc curve""" wateroil = WaterOil(swirr=swirr, swl=swirr + dswl) wateroil.add_simple_J() pc_max = wateroil.table["pc"].max() pc_min = wateroil.table["pc"].min() pc_fn = normalize_pc(wateroil) assert np.isclose(pc_fn(0), pc_max) assert np.isclose(pc_fn(1), pc_min)