Ignore:
Timestamp:
Apr 29, 2010 9:30:47 PM (12 years ago)
Author:
toby
Message:

fixup unit test for GSASIIspg.py; provide files & Makefile for pyspg.for

Location:
trunk/testinp
Files:
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/testinp/gensgtbx.py

    r30 r57  
    22'''
    33Generate symmetry operations in cctbx.sgtbx for use in testing the
    4 GSASII space group generation code. I think one of the 230 spacegroups
    5 is missing from the list below; but there are two settings included for the
    6 rhombohedral groups.
    7 
    8 Redirect output to sgtbxdat.py to create the input file for testing.
     4GSASII space group generation code. All 230 spacegroups are tested plus
     5rhombohedral settings of R space groups.
     6
     7 The output from this is placed in sgtbxtestinp.py which contains a dictionary
     8 sgtbx that can be used for testing.
     9
    910'''
    1011
    1112from cctbx import sgtbx
     13import sys
     14import datetime
    1215
    1316def GenSGdat(spc):
    14     print "'%s': [" % spc
     17    fp.write("'%s': [\n" % spc)
    1518    s=sgtbx.space_group_info(spc)
    1619    for s1 in s.group():
    17         print s1.as_double_array(),","
    18     print "],\n"
    19 print "sgtbx = {"
     20#        print s1.as_double_array()
     21        fp.write("%s ,\n" % (s1.as_double_array(),))
     22    fp.write("],\n\n")
     23
     24fp = open('sgtbxtestinp.py','w')
     25fp.write("# output from sgtbx computed on platform %s on %s\n" %
     26         (sys.platform, datetime.date.today()) )
     27fp.write("sgtbx = {\n")
    2028#cubic
    2129GenSGdat('p 2 3')
     
    121129GenSGdat('p 43')
    122130GenSGdat('i 4')
    123 #GenSGdat('i 41 1 1') # not accepted by cctbx
    124131GenSGdat('i 41')
    125132GenSGdat('p -4')
     
    127134GenSGdat('p 4/m')
    128135GenSGdat('p 42/m')
    129 #GenSGdat('p 4/n 1 ') # does not work
    130136GenSGdat('p 4/n')
    131137GenSGdat('p 42/n')
     
    138144GenSGdat('p 42 2 2')
    139145GenSGdat('p 42 21 2')
    140 GenSGdat('p 43 2 2 ')
     146GenSGdat('p 43 2 2')
    141147GenSGdat('p 43 21 2')
    142148GenSGdat('i 4 2 2')
     
    144150GenSGdat('p 4 m m')
    145151GenSGdat('p 4 b m')
    146 GenSGdat('p 2 c m')
     152GenSGdat('p 42 c m')
    147153GenSGdat('p 42 n m')
    148154GenSGdat('p 4 c c')
     
    183189GenSGdat('p 42/n c m')
    184190GenSGdat('i 4/m m m')
    185 GenSGdat('i 4/m c m ')
     191GenSGdat('i 4/m c m')
    186192GenSGdat('i 41/a m d')
    187193GenSGdat('i 41/a c d')
     
    192198GenSGdat('p 2')
    193199GenSGdat('p 21')
    194 GenSGdat('c 2 1 1')
     200GenSGdat('c 2')
    195201GenSGdat('p m')
    196202GenSGdat('p c')
    197203GenSGdat('c m')
    198204GenSGdat('c c')
    199 GenSGdat('p 1 2/m 1')
     205GenSGdat('p 2/m')
    200206GenSGdat('p 21/m')
    201207GenSGdat('c 2/m')
    202208GenSGdat('p 2/c')
    203209GenSGdat('p 21/c')
    204 GenSGdat('c 1 2/c 1')
     210GenSGdat('c 2/c')
    205211# trigonal
     212GenSGdat('p 3')
    206213GenSGdat('p 31')
    207 #GenSGdat('p 32 1 1')  # not accepted by cctbx
    208214GenSGdat('p 32')
    209215GenSGdat('r 3')
     
    239245GenSGdat('p 6')
    240246GenSGdat('p 61')
    241 #GenSGdat('p 65 1 1')  # not accepted by cctbx
    242247GenSGdat('p 65')
    243248GenSGdat('p 62')
     
    245250GenSGdat('p 63')
    246251GenSGdat('p -6')
    247 #GenSGdat('p 6/m 1 1')  # not accepted by cctbx
    248252GenSGdat('p 6/m')
    249253GenSGdat('p 63/m')
     
    266270GenSGdat('p 63/m c m')
    267271GenSGdat('p 63/m m c')
    268 
    269 print "}"
     272# non-standard
     273GenSGdat('p 21 1 1')
     274GenSGdat('p 1 21 1')
     275GenSGdat('p 1 1 21')
     276fp.write("}\n")
     277fp.close()
Note: See TracChangeset for help on using the changeset viewer.