Пример #1
0
 def test_invalid_argument(self,function):
     s = Symmetry()                                                                              # noqa
     with pytest.raises(ValueError):
         eval(f's.{function}(np.ones(4))')
Пример #2
0
 def test_in_disorientation_SST(self,system):
       assert Symmetry(system).in_disorientation_SST(np.zeros(3))
Пример #3
0
 def test_in_SST(self,system,proper):
       assert Symmetry(system).in_SST(np.zeros(3),proper)
Пример #4
0
 def test_not_equal(self):
     symmetries = random.sample(Symmetry.crystal_systems,k=2)
     assert Symmetry(symmetries[0]) != Symmetry(symmetries[1])
Пример #5
0
 def test_in_FZ(self,system):
       assert Symmetry(system).in_FZ(np.zeros(3))
Пример #6
0
 def test_invalid_symmetry(self,invalid_symmetry):
     with pytest.raises(KeyError):
         s = Symmetry(invalid_symmetry)                                                          # noqa
Пример #7
0
 def test_equal(self):
     symmetry = random.choice(Symmetry.crystal_systems)
     print(symmetry)
     assert Symmetry(symmetry) == Symmetry(symmetry)
Пример #8
0
 def test_in_disorientation_SST_vectorize(self,set_of_rodrigues,system):
     result = Symmetry(system).in_disorientation_SST(set_of_rodrigues.reshape(50,4,3)).reshape(200)
     for i,r in enumerate(result):
         assert r == in_disorientation_SST(system,set_of_rodrigues[i])
Пример #9
0
 def test_in_SST_vectorize(self,system,proper):
     vecs = np.random.rand(20,4,3)
     result = Symmetry(system).in_SST(vecs,proper).reshape(20*4)
     for i,r in enumerate(result):
         assert r == in_SST(system,vecs.reshape(20*4,3)[i],proper)
Пример #10
0
 def test_inSST(self, lattice, proper):
     assert Symmetry(lattice).inSST(np.zeros(3), proper)
Пример #11
0
 def test_inDisorientationSST(self, lattice):
     assert Symmetry(lattice).inDisorientationSST(np.zeros(3))
Пример #12
0
 def test_inFZ(self, lattice):
     assert Symmetry(lattice).inFZ(np.zeros(3))
Пример #13
0
 def test_not_equal(self):
     symmetries = random.sample(Symmetry.lattices, k=2)
     assert Symmetry(symmetries[0]) != Symmetry(symmetries[1])
Пример #14
0
 def test_equal(self):
     symmetry = random.choice(Symmetry.lattices)
     print(symmetry)
     assert Symmetry(symmetry) == Symmetry(symmetry)