Changeset 5368


Ignore:
Timestamp:
Nov 11, 2022 9:25:48 AM (11 months ago)
Author:
toby
Message:

fix validated textctrl bug that caused contents to revert; docs formatting

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIctrlGUI.py

    r5366 r5368  
    801801            self._setValue(self.result[self.key])
    802802        elif self.result is not None: # show formatted result, as Bob wants
     803            self.result[self.key] = self.GetValue()
    803804            if not self.invalid: # don't update an invalid expression
    804805                self._setValue(self.result[self.key])
  • trunk/GSASIIplot.py

    r5363 r5368  
    5353:func:`PlotLayers`            show layer structures as balls & sticks
    5454:func:`PlotFPAconvolutors`    plots the convolutors from Fundamental Parameters
    55 :func:'PlotClusterYYZ'plots the result of cluster analysis
     55:func:'PlotClusterYYZ'        plots the result of cluster analysis
    5656============================  ===========================================================================
    5757
  • trunk/nistlat.py

    r5364 r5368  
    2020cell reduction matrix terms.
    2121
    22 [if used cite: V. L. Karen and A. D. Mighell, NIST Technical Note 1290 (1991),
     22Please cite V. L. Karen and A. D. Mighell, NIST Technical Note 1290 (1991),
    2323https://nvlpubs.nist.gov/nistpubs/Legacy/TN/nbstechnicalnote1290.pdf;
    2424and V. L. Karen & A. D. Mighell, U.S. Patent 5,235,523,
    25 https://patents.google.com/patent/US5235523A/en?oq=5235523]
    26 
    27 This is still under development; not yet in use.
    28 
    29 Work to come: "Relate two unit cells"
     25https://patents.google.com/patent/US5235523A/en?oq=5235523 if this module
     26is used.
     27
     28This will be deployed in GSAS-II after a release of updated binary images.
     29
    3030'''
    3131
     
    4343def showCell(cell,center='P',setting=' ',*ignored):
    4444    '''show unit cell input or output nicely formatted.
     45
    4546    :param list cell: six lattice constants as float values; a 7th volume value
    4647      is ignored if present.
     
    6263def uniqCells(cellList):
    6364    '''remove duplicated cells from a cell output list from :func:`ReduceCell`
     65
    6466    :param list cellList: A list of reduced cells where each entry represents a
    6567      reduced cell as (_,cell,_,_,center,...) where cell has six lattice
     
    7678    return uList
    7779
    78 def emulateLP(line,fp):
     80def _emulateLP(line,fp):
    7981    '''Emulate an antique 132 column line printer, where the first column
    8082    that is printed is used for printer control. '1' starts a new page
     
    105107    :param list cellin: six lattice constants as float values
    106108    :param int mode:
    107         0: reduction,
    108         1: generate supercells,
    109         2: generate subcells
    110         3: generate sub- and supercells
     109
     110        * 0: reduction,
     111        * 1: generate supercells,
     112        * 2: generate subcells
     113        * 3: generate sub- and supercells
     114
    111115    :param int deltaV: volume ratios for sub/supercells if mode != 0 as
    112116      ratio of original cell to smallest subcell or largest supercell
    113117      to original cell. Ignored if mode=0. Otherwise should be 2, 3, 4 or 5
    114     :param str output: name of file to write the NIST*LATTICE output 
    115     :returns: a dict with item 'input' with input cell as (cell,center,setting)
    116       and 'output' which is a list of reduced cells of form
    117       (d,cell,vol,mat,center,setting). In these,
    118         cell: is the six cell dimensions;
    119         center: is as above (always 'P' on output);
    120         setting: is ' ' except for rhombohedral symmetry where it may be R or H for the cell type;
    121         d: is the volume ratio for new cell over input cell;
    122         vol: is volume of output cell
    123         mat: is the matrix that gives the output cell when the input cell is multiplied by mat.     
     118    :param str output: name of file to write the NIST*LATTICE output.
     119      Default is None, which does not produce a file.   
     120    :returns: a dict with two items, 'input' and 'output'. The value for
     121      'input' is the input cell as (cell,center,setting). The value for
     122      'output' is a list of reduced cells of form
     123      (d,cell,vol,mat,center,setting). In these:
     124
     125        * cell: a list with the six cell dimensions;
     126        * center: is as above (always 'P' on output);
     127        * setting: is ' ' except for rhombohedral symmetry where it may be R or H for the cell type;
     128        * d: is the volume ratio for new cell over input cell;
     129        * vol: is volume of output cell
     130        * mat: is the matrix that gives the output cell when the input cell is multiplied by mat.
    124131    '''
    125132
     
    157164            linenum += 1
    158165            line = b.decode()
    159             emulateLP(line,fp)
     166            _emulateLP(line,fp)
    160167            pat = r"T 2= (.*)/ (.*)/ (.*)"  # transform matrix
    161168            s = re.split(pat,line)
     
    187194def ConvCell(redcell):
    188195    '''Converts a reduced cell to a conventional cell
     196
    189197    :param list redcell: unit cell parameters as 3 cell lengths
    190198      and 3 angles (in degrees)
    191     :returns: tuple (cell,center,setting,mat) where
    192         cell: has the six cell dimensions for the conventional cell;
    193         center: is P/A/B/C/F/I/R;
    194         setting: is ' ' except for rhombohedral symmetry (center=R), where
     199    :returns: tuple (cell,center,setting,mat) where:
     200 
     201        * cell: has the six cell dimensions for the conventional cell;
     202        * center: is P/A/B/C/F/I/R;
     203        * setting: is ' ' except for rhombohedral symmetry (center=R), where
    195204          it will always be H (for hexagonal cell choice);
    196         mat: is the matrix that gives the conventional cell when the reduced
     205        * mat: is the matrix that gives the conventional cell when the reduced
    197206          cell is multiplied by mat.
    198207    '''
     
    252261       Must be 1 <= vrange <= 10 for mode='F' or
    253262       Must be 1 <= vrange <= 40 for mode='I'
    254     :param str output: name of file to write the NIST*LATTICE output 
    255 
    256     :returns: a list of matrices that match cell1 to cell2 where
    257       each entry contains (det, im, m, tol, one2two, two2one) where
    258       0: det is the determinant, giving the volume ratio between cells
    259       1: im relates the reduced cell for cell1 to the reduced cell for cell2
    260       2: m relates the reduced cell for cell2 to the reduced cell for cell1
    261       3: tol quality of agreement as six differences between the
    262         two reduced cells
    263       4: one2two numpy matrix that transforms cell1 to cell2
    264       5: two2one numpy matrix that transforms cell2 to cell1
     263    :param str output: name of file to write the NIST*LATTICE output.
     264      Default is None, which does not produce a file.   
     265
     266    :returns: A list of matrices that match cell1 to cell2 where
     267      each entry contains (det, im, m, tol, one2two, two2one) where:
     268
     269        * det is the determinant, giving the volume ratio between cells
     270        * im relates the reduced cell for cell1 to the reduced cell for cell2
     271        * m relates the reduced cell for cell2 to the reduced cell for cell1
     272        * tol shows the quality of agreement, as six differences between the
     273             two reduced cells
     274        * one2two: a numpy matrix that transforms cell1 to cell2
     275        * two2one: a numpy matrix that transforms cell2 to cell1
    265276    '''
    266277    # reduce input cells. Save cell, volume and matrix
     
    293304    p.terminate()
    294305    if fp:
    295         for line in lines: emulateLP(line,fp)
     306        for line in lines: _emulateLP(line,fp)
    296307        fp.close()
    297308    lnum = 0
     
    348359
    349360def CellSymSearch(cellin, center, tolerance=3*[0.2]+3*[1], mode=0,
    350                       deltaV=2, minsym=' ', output=None):
     361                      deltaV=2, output=None):
    351362    '''Search for a higher symmetry lattice related to an input unit cell,
    352363    and optionally to the supercells and/or subcells with a specified
     
    360371      & gamma (defaults to [0.2,0.2,0.2,1.,1.,1.]
    361372    :param int mode:
    362         0: use only input cell,
    363         1: generate supercells,
    364         2: generate subcells
    365         3: generate sub- and supercells
     373
     374        * 0: use only input cell,
     375        * 1: generate supercells,
     376        * 2: generate subcells
     377        * 3: generate sub- and supercells
     378
    366379    :param int deltaV: volume ratios for sub/supercells if mode != 0 as
    367380      ratio of original cell to smallest subcell or largest supercell
    368381      to original cell. Ignored if mode=0. Otherwise should be 2, 3, 4 or 5
    369     :param ? minsym:
    370     :param str output: name of file to write the NIST*LATTICE output 
    371 
    372     :returns: a list of processed cells (only one if mode=0) where for each cell the
    373       the following items are included: conventional input cell; reduced input cell;
    374       symmetry-generated conventional cell; symmetry-generated reduced cell;
    375       matrix to convert sym-generated output cell to input conventional cell
     382    :param str output: name of file to write the NIST*LATTICE output. Default
     383      is None, which does not produce a file.
     384
     385    :returns: a list of processed cells (only one entry in list when mode=0)
     386      where for each cell the the following items are included:
     387
     388        * conventional input cell;
     389        * reduced input cell;
     390        * symmetry-generated conventional cell;
     391        * symmetry-generated reduced cell;
     392        * matrix to convert sym-generated output cell to input conventional cell
    376393    '''
    377394    # setting is non-blank for rhombohedral lattices (center=R) only.
     
    406423    if output: fp = open(output,'w')
    407424    if fp:
    408         for line in lines: emulateLP(line,fp)
     425        for line in lines: _emulateLP(line,fp)
    409426        fp.close()
    410427    lnum = 0
Note: See TracChangeset for help on using the changeset viewer.