Example #1
0
def test__update_rsh_fixed_pt_vmp0():
    outrsh = sdm._update_rsh_fixed_pt(vmp=0.,
                                      imp=2.,
                                      iph=2.,
                                      io=2.,
                                      rs=2.,
                                      rsh=2.,
                                      nnsvth=2.)
    np.testing.assert_allclose(outrsh, np.array([502.]), atol=.0001)
Example #2
0
def test__update_rsh_fixed_pt_vector():
    outrsh = sdm._update_rsh_fixed_pt(rsh=np.array([-1., 3, .5, 2.]),
                                      rs=np.array([1., -.5, 2., 2.]),
                                      io=np.array([.2, .3, -.4, 2.]),
                                      iph=np.array([-.1, 1, 3., 2.]),
                                      nnsvth=np.array([4., -.2, .1, 2.]),
                                      imp=np.array([.2, .2, -1., 2.]),
                                      vmp=np.array([0., -1, 0., 0.]))
    assert np.all(np.isnan(outrsh[0:3]))
    np.testing.assert_allclose(outrsh[3], np.array([502.]), atol=.0001)
Example #3
0
def test__update_rsh_fixed_pt_nans(vmp, imp, iph, io, rs, rsh, nnsvth,
                                   expected):
    outrsh = sdm._update_rsh_fixed_pt(vmp, imp, iph, io, rs, rsh, nnsvth)
    assert np.all(np.isnan(outrsh))