Changeset 3061 for trunk/GSASIIobj.py


Ignore:
Timestamp:
Sep 9, 2017 3:35:36 PM (4 years ago)
Author:
toby
Message:

sort variable names

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIIobj.py

    r3041 r3061  
    16191619        return dic.get(key,'?')
    16201620
     1621def SortVariables(varlist):
     1622    '''Sorts variable names in a sensible manner
     1623    '''
     1624    def cvnnums(var):
     1625        v = []
     1626        for i in var.split(':'):
     1627            try:
     1628                v.append(int(i))
     1629            except:
     1630                v.append(i)
     1631        return v
     1632    return sorted(varlist,key=cvnnums)
     1633
    16211634class G2VarObj(object):
    16221635    '''Defines a GSAS-II variable either using the phase/atom/histogram
Note: See TracChangeset for help on using the changeset viewer.