def test_known_data(self): """Minimalistic test.""" f = lambda L, x, z : 1. + 2./L**2 + 1./z f_tli = lambda L, x, z : 2./L**2 tli_L = (5, 10, 20, 30) tli_v, d_tli_v, cl = tli(lambda L, x, z : 1. + 2./L**2, (), range(50,100,2), 10, tli_L, 0, 2) tli_known = [f_tli(L, 0, 2) for L in tli_L] for known, testme in zip (tli_known, tli_v): self.assertAlmostEqual(known, testme)
obs.RPSV : theta_args, obs.YPS : theta_args, obs.logYPS : theta_args, obs.YV : theta_args, obs.logYV : theta_args, obs.RYPSV : theta_args, obs.RYPS : theta_pairs, obs.RYV : theta_pairs, obs.R1 : theta_pairs, obs.logR1 : theta_pairs, obs.RA : theta_pairs, obs.logRA : theta_pairs, obs.RP : theta_pairs, obs.logRP : theta_pairs, obs.RV : theta_pairs, obs.logRV : theta_pairs} for z in zrange: print " * z =", z # this is my value for x x = sopt.newton(min_x(z, LAMBDAL, NF), .7, tol=1e-15) for O in arguments: print " *", O.__name__ for arg in arguments[O]: delta, d_delta, cl = \ tli(O, arg, Lrange, 17, lrange, x, z) print " *", arg for L, d, dd in zip(lrange, delta, d_delta): print " ", L, pretty_print(d,dd)