Ejemplo n.º 1
0
def test_constraint():
    sch = ImageSchema(100)
    with warnings.catch_warnings():
        # TODO: we should really only supress overlap warnings here,
        # but I am too lazy to figure it out right now, and I don't
        # think we are likely to hit warnings here that won't get
        # caught elsewhere -tgd 2013-12-01
        warnings.simplefilter("ignore")
        spheres = Spheres([Sphere(r=.5, center=(0,0,0)),
                           Sphere(r=.5, center=(0,0,par(.2)))])
        model = Model(spheres, Multisphere.calc_holo, constraints=limit_overlaps())
        coster = CostComputer(sch, model)
        cost = coster._calc({'1:Sphere.center[2]' : .2})
        assert_equal(cost, np.ones_like(sch)*np.inf)
Ejemplo n.º 2
0
def test_constraint():
    sch = ImageSchema(100)
    with warnings.catch_warnings():
        # TODO: we should really only supress overlap warnings here,
        # but I am too lazy to figure it out right now, and I don't
        # think we are likely to hit warnings here that won't get
        # caught elsewhere -tgd 2013-12-01
        warnings.simplefilter("ignore")
        spheres = Spheres([Sphere(r=.5, center=(0,0,0)),
                           Sphere(r=.5, center=(0,0,par(.2)))])
        model = Model(spheres, Multisphere.calc_holo, constraints=limit_overlaps())
        coster = CostComputer(sch, model)
        cost = coster._calc({'1:Sphere.center[2]' : .2})
        assert_equal(cost, np.ones_like(sch)*np.inf)