Changeset 577 for trunk/GSASIImapvars.py


Ignore:
Timestamp:
Apr 27, 2012 9:45:26 AM (9 years ago)
Author:
toby
Message:

fix error in reporting constraint errors

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIImapvars.py

    r570 r577  
    273273        errmsg += "\nThe following parameters(s) are used as both dependent and independent variables in Equivalence relations:\n"
    274274        s = ''
    275         for var in inboth:
     275        for var in sorted(inboth):
    276276            if s != "": s+= ", "
    277             s += str(v)
     277            s += str(var)
    278278        errmsg += '\t'+ s + '\n'
    279279    if len(multdepVarList) > 0:
    280280        errmsg += "\nThe following parameters(s) are used in multiple Equivalence relations as dependent variables:\n"
    281281        s = ''
    282         for var in multdepVarList:
     282        for var in sorted(set(multdepVarList)):
    283283            if s != "": s+= ", "
    284             s += str(v)           
     284            s += str(var)           
    285285        errmsg += '\t'+ s + '\n'
    286286    equivVarList = list(set(indepVarList).union(set(depVarList)))
     
    290290        errmsg += "\nThe following parameter(s) are used in both Equivalence and Fixed constraints:\n"
    291291        s = ''
    292         for var in inboth:
     292        for var in sorted(inboth):
    293293            if s != "": s+= ", "
    294             s += str(v)
     294            s += str(var)
    295295        errmsg += '\t'+ s + '\n'
    296296
     
    436436            zeromult = False
    437437            for mv in mapvars:
     438                #s = ''
    438439                varied = 0
    439440                notvaried = ''
     
    445446                if mv not in indepVarList: indepVarList.append(mv)
    446447                for v,m in zip(varlist,invmultarr):
     448                    #if len(s): s += '  & '
     449                    #s += str(v)
     450                    #if m != 1:
     451                    #    s += " / " + str(m[0])                       
    447452                    if m == 0: zeromult = True
    448453                    if v in varyList:
     
    455460                    else:
    456461                        depVarList.append(v)
     462                #print str(mv) + ' is equivalent to parameter(s): '+s
    457463            if varied > 0 and varied != len(varlist)+1:
    458464                msg += "\nNot all variables refined in equivalence:\n\t"
     
    478484        msg += "\nThe following parameters(s) are used as both dependent and independent variables in Equivalence relations:\n"
    479485        s = ''
    480         for var in inboth:
     486        for var in sorted(inboth):
    481487            if s != "": s+= ", "
    482             s += str(v)
     488            s += str(var)
    483489        msg += '\t'+ s + '\n'
    484490    if len(multdepVarList) > 0:
    485491        msg += "\nThe following parameters(s) are used in multiple Equivalence relations as dependent variables:\n"
    486492        s = ''
    487         for var in multdepVarList:
     493        for var in sorted(set(multdepVarList)):
    488494            if s != "": s+= ", "
    489             s += str(v)           
     495            s += str(var)           
    490496        msg += '\t'+ s + '\n'
    491497    equivVarList = list(set(indepVarList).union(set(depVarList)))
     
    495501        msg += "\nError! The following variables are used in both Equivalence and Fixed constraints:\n"
    496502        s = ''
    497         for var in inboth:
     503        for var in sorted(inboth):
    498504            if s != "": s+= ", "
    499             s += str(v)
     505            s += str(var)
    500506        msg += '\t'+ s + '\n'
    501507
Note: See TracChangeset for help on using the changeset viewer.