def test_invalid_argument(self,function): s = Symmetry() # noqa with pytest.raises(ValueError): eval(f's.{function}(np.ones(4))')
def test_in_disorientation_SST(self,system): assert Symmetry(system).in_disorientation_SST(np.zeros(3))
def test_in_SST(self,system,proper): assert Symmetry(system).in_SST(np.zeros(3),proper)
def test_not_equal(self): symmetries = random.sample(Symmetry.crystal_systems,k=2) assert Symmetry(symmetries[0]) != Symmetry(symmetries[1])
def test_in_FZ(self,system): assert Symmetry(system).in_FZ(np.zeros(3))
def test_invalid_symmetry(self,invalid_symmetry): with pytest.raises(KeyError): s = Symmetry(invalid_symmetry) # noqa
def test_equal(self): symmetry = random.choice(Symmetry.crystal_systems) print(symmetry) assert Symmetry(symmetry) == Symmetry(symmetry)
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])
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)
def test_inSST(self, lattice, proper): assert Symmetry(lattice).inSST(np.zeros(3), proper)
def test_inDisorientationSST(self, lattice): assert Symmetry(lattice).inDisorientationSST(np.zeros(3))
def test_inFZ(self, lattice): assert Symmetry(lattice).inFZ(np.zeros(3))
def test_not_equal(self): symmetries = random.sample(Symmetry.lattices, k=2) assert Symmetry(symmetries[0]) != Symmetry(symmetries[1])
def test_equal(self): symmetry = random.choice(Symmetry.lattices) print(symmetry) assert Symmetry(symmetry) == Symmetry(symmetry)