Esempio n. 1
0
    def test_coord_wrap_box(self):
        xyz = np.array([[3, 3, 1], [1, 1, 0]])

        box = mb.Box(lengths=[2.0, 2.0, 2.0], angles=[90, 90, 90])

        new_xyz = wrap_coords(xyz, box, mins=np.min(xyz, axis=0))

        assert (new_xyz[0, :] == np.array([1, 1, 1])).all()
        assert (new_xyz[1, :] == xyz[1, :]).all()
Esempio n. 2
0
    def test_coord_wrap_box(self):
        xyz = np.array([[3, 3, 1], [1, 1, 0]])

        box = mb.Box(mins=[-2.0, -2.0, -2.0], maxs=[2.0, 2.0, 2.0])

        new_xyz = wrap_coords(xyz, box)

        assert (new_xyz[0, :] == np.array([-1, -1, 1])).all()
        assert (new_xyz[1, :] == xyz[1, :]).all()
Esempio n. 3
0
 def test_coord_wrap(self):
     xyz = np.array([[3, 3, 1], [1, 1, 0]])
     box = [2, 2, 2]
     new_xyz = wrap_coords(xyz, box)
     assert (new_xyz[0, :] == np.array([1, 1, 1])).all()
     assert (new_xyz[1, :] == xyz[1, :]).all()