Compare theory vs. sim scaled by bin width (not theory, which may be zero).
authorW. Trevor King <wking@drexel.edu>
Sat, 6 Nov 2010 14:21:20 +0000 (07:21 -0700)
committerW. Trevor King <wking@drexel.edu>
Sat, 6 Nov 2010 14:21:20 +0000 (07:21 -0700)
pysawsim/test/bell_rate.py

index a49da052de007a3ddffb14a96763154015af5c52..b002a9a2d7d9c49be12012dd71467151905e50f7 100644 (file)
@@ -179,7 +179,8 @@ def bell_rate(sawsim_runner, num_domains=1, unfolding_rate=1,
     sim_alpha = params[0]
     sim_rho = abs(params[1])
     for s,t,n in [(sim_alpha, alpha, 'alpha'), (sim_rho, rho, 'rho')]:
     sim_alpha = params[0]
     sim_rho = abs(params[1])
     for s,t,n in [(sim_alpha, alpha, 'alpha'), (sim_rho, rho, 'rho')]:
-        assert (s - t)/t < 0.1, 'simulation %s = %g != %g = %s' % (n,s,t,n))
+        assert (s - t)/w < 2, (
+            'simulation %s = %g != %g = %s (bin width = %g)' % (n,s,t,n,w))
     return sim.residual(theory)
 
 
     return sim.residual(theory)