示例#1
0
 def test_shooting_move(self):
     self.shooter = BackwardShootMover(ensemble=self.ens,
                                       selector=FinalFrameSelector(),
                                       engine=self.dyn)
     change = self.shooter.move(self.gs)
     samples = change.trials
     assert_equal(change.accepted, True)
     assert_items_equal(
         [0.1, 0.2, 0.3, 0.4, 0.5],
         [s.coordinates[0][0] for s in samples[0].trajectory])
示例#2
0
class TestFinalFrameSelector(SelectorTest):
    def test_pick(self):
        sel = FinalFrameSelector()
        sp = sel.pick(self.mytraj)
        assert sp == 4
        snap = self.mytraj[sp]
        assert snap.coordinates[0][0] == 0.5

    def test_shooting_move(self):
        self.shooter = BackwardShootMover(
            ensemble=self.ens,
            selector=FinalFrameSelector(),
            engine=self.dyn
        )
        change = self.shooter.move(self.gs)
        samples = change.trials
        assert change.accepted is True
        assert_items_equal(
            [0.1, 0.2, 0.3, 0.4, 0.5],
            [s.coordinates[0][0] for s in samples[0].trajectory]
        )

    def test_f(self):
        sel = FinalFrameSelector()
        for frame in self.mytraj[:-1]:
            assert sel.f(frame, self.mytraj) == 0
        assert sel.f(self.mytraj[-1], self.mytraj) == 1
class TestFinalFrameSelector(SelectorTest):
    def test_pick(self):
        sel = FinalFrameSelector()
        sp = sel.pick(self.mytraj)
        assert_equal(sp, 4)
        snap = self.mytraj[sp]
        assert_equal(snap.coordinates[0][0], 0.5)

    def test_shooting_move(self):
        self.shooter = BackwardShootMover(
            ensemble=self.ens,
            selector=FinalFrameSelector(),
            engine=self.dyn
        )
        change = self.shooter.move(self.gs)
        samples = change.trials
        assert_equal(change.accepted, True)
        assert_items_equal(
            [0.1, 0.2, 0.3, 0.4, 0.5],
            [s.coordinates[0][0] for s in samples[0].trajectory]
        )

    def test_f(self):
        sel = FinalFrameSelector()
        for frame in self.mytraj[:-1]:
            assert sel.f(frame, self.mytraj) == 0
        assert sel.f(self.mytraj[-1], self.mytraj) == 1
示例#4
0
 def test_shooting_move(self):
     self.shooter = BackwardShootMover(
         ensemble=self.ens,
         selector=FinalFrameSelector()
     )
     change = self.shooter.move(self.gs)
     samples = change.trials
     assert_equal(change.accepted, True)
     assert_items_equal([0.1, 0.2, 0.3, 0.4, 0.5],
                        [s.coordinates[0][0] for s in samples[0].trajectory]
                       )
示例#5
0
class testFinalFrameSelector(SelectorTest):
    def test_pick(self):
        sel = FinalFrameSelector()
        sp = sel.pick(self.mytraj)
        assert_equal(sp, 4)
        snap = self.mytraj[sp]
        assert_equal(snap.coordinates[0][0], 0.5)

    def test_shooting_move(self):
        self.shooter = BackwardShootMover(ensemble=self.ens,
                                          selector=FinalFrameSelector(),
                                          engine=self.dyn)
        change = self.shooter.move(self.gs)
        samples = change.trials
        assert_equal(change.accepted, True)
        assert_items_equal(
            [0.1, 0.2, 0.3, 0.4, 0.5],
            [s.coordinates[0][0] for s in samples[0].trajectory])
示例#6
0
class testFinalFrameSelector(SelectorTest):
    def test_pick(self):
        sel = FinalFrameSelector()
        sp = sel.pick(self.mytraj)
        assert_equal(sp.selector, sel)
        assert_equal(sp.trajectory, self.mytraj)
        assert_equal(sp.index, 4)
        assert_equal(sp.f, 1.0)
        assert_equal(sp.sum_bias, 1.0)
        snap = sp.snapshot
        assert_equal(snap.coordinates[0][0], 0.5)

    def test_shooting_move(self):
        self.shooter = BackwardShootMover(
            ensemble=self.ens,
            selector=FinalFrameSelector()
        )
        change = self.shooter.move(self.gs)
        samples = change.trials
        assert_equal(change.accepted, True)
        assert_items_equal([0.1, 0.2, 0.3, 0.4, 0.5],
                           [s.coordinates[0][0] for s in samples[0].trajectory]
                          )