Пример #1
0
 def test_symmetry1(self):
     for i in range(self.nrep):
         n = random.randint(0, 1000)
         v = Velocity(dim=3, num=n)
         vs = v.get_symmetric().get_symmetric()
         assert (vs.vx == v.vx and vs.vy == v.vy and vs.vz == v.vz
                 and vs.num == v.num)
Пример #2
0
 def test_symmetry3(self):
     for i in range(self.nrep):
         n = random.randint(0, 1000)
         v = Velocity(dim=2, num=n)
         vs = v.get_symmetric(axis=0).get_symmetric(axis=1)
         vs = vs.get_symmetric(axis=0).get_symmetric(axis=1)
         assert (vs.vx == v.vx and vs.vy == v.vy and vs.num == v.num)
Пример #3
0
 def test_symmetry5(self):
     v = Velocity(dim=2, num=0)
     vs = v.get_symmetric(axis=2).get_symmetric(axis=2)
Пример #4
0
 def test_symmetry4(self):
     for n, sn in zip(self.num, self.snum):
         v = Velocity(dim=2, num=n)
         vs = v.get_symmetric()
         assert (vs.num == sn)
Пример #5
0
def test_velocity_argument():
    Velocity()
Пример #6
0
 def test_with_v(self):
     for n, vx, vy in zip(self.num, self.vx, self.vy):
         v = Velocity(vx=vx, vy=vy)
         assert (v.num == n and v.dim == 2)
Пример #7
0
 def test_with_num(self):
     for n, vx, vy in zip(self.num, self.vx, self.vy):
         v = Velocity(dim=2, num=n)
         assert (v.vx == vx and v.vy == vy)
Пример #8
0
 def test_symmetry3(self):
     v = Velocity(dim=1, num=random.randint(0, 1000))
     vs = v.get_symmetric(axis=1).get_symmetric(axis=1)
Пример #9
0
 def test_symmetry2(self):
     v = Velocity(dim=1, num=random.randint(0, 1000))
     vs = v.get_symmetric(axis=0).get_symmetric(axis=0)
     assert (vs.vx == v.vx and vs.num == v.num)
Пример #10
0
 def test_with_vx(self):
     for n, vx in zip(self.num, self.vx):
         v = Velocity(vx=vx)
         assert (v.num == n and v.dim == 1)
Пример #11
0
 def test_with_num(self):
     for n, vx in zip(self.num, self.vx):
         v = Velocity(dim=1, num=n)
         assert (v.vx == vx)
Пример #12
0
 def test_with_v(self):
     for n, vx, vy, vz in zip(self.num, self.vx, self.vy, self.vz):
         v = Velocity(vx=vx, vy=vy, vz=vz)
         assert (v.num == n and v.dim == 3)
Пример #13
0
 def test_with_num(self):
     for n, vx, vy, vz in zip(self.num, self.vx, self.vy, self.vz):
         v = Velocity(dim=3, num=n)
         assert (v.vx == vx and v.vy == vy and v.vz == vz)