Skip to content

Commit

Permalink
Fix tetragonal generators
Browse files Browse the repository at this point in the history
  • Loading branch information
jonwright committed Jul 25, 2018
1 parent c608b3a commit d6b0fc2
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ImageD11/sym_u.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def rhombohedralP():

def tetragonal():
""" P4 75"""
return generate_group ( "-y,x,z", "-x,-y,z" )
return generate_group ( "-y,x,z", "-x,y,-z" )

def orthorhombic():
""" P222 16 """
Expand All @@ -158,7 +158,7 @@ def monoclinic_b():
return generate_group("-x,y,-z" )

def triclinic():
return generate_group("-x,-y,-z" )
return generate_group("x, y, z" )


def find_uniq_u(u, grp, debug=0, func=np.trace):
Expand Down
1 change: 1 addition & 0 deletions test/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
sys.path.insert(0,".")

modules = [
"test_sym_u",
"test_cImageD11",
"gv_general.test_gv_general",
"testcolumnfile",
Expand Down
42 changes: 42 additions & 0 deletions test/test_sym_u.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@


import ImageD11.sym_u
import unittest

class testsyms( unittest.TestCase ):

def test_cubic(self):
c = ImageD11.sym_u.cubic()
assert len(c.group) == 24

def test_hexagonal(self):
c = ImageD11.sym_u.hexagonal()
assert len(c.group) == 12

def test_tetragonal(self):
c = ImageD11.sym_u.tetragonal()
assert len(c.group) == 8

def test_orthorhombic(self):
c = ImageD11.sym_u.orthorhombic()
assert len(c.group) == 4

def test_monoclinic(self):
c = ImageD11.sym_u.monoclinic_a()
assert len(c.group) == 2
c = ImageD11.sym_u.monoclinic_b()
assert len(c.group) == 2
c = ImageD11.sym_u.monoclinic_c()
assert len(c.group) == 2

def test_triclinic(self):
c = ImageD11.sym_u.triclinic()
assert len(c.group) == 1



if __name__=="__main__":
unittest.main()



0 comments on commit d6b0fc2

Please sign in to comment.