Changeset 1247 for trunk/GSASIImapvars.py
- Timestamp:
- Mar 12, 2014 3:46:47 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/GSASIImapvars.py
r1243 r1247 416 416 for var in constrDict[rel]: 417 417 if var.startswith('_'): continue 418 if not re.match('[0-9]*:[0-9 ]*:',var):418 if not re.match('[0-9]*:[0-9\*]*:',var): 419 419 warnmsg += "\nVariable "+str(var)+" does not begin with a ':'" 420 420 if var in varyList: … … 511 511 return errmsg,warnmsg 512 512 513 def GenerateConstraints(groups,parmlist,varyList,constrDict,fixedList,parmDict=None ):513 def GenerateConstraints(groups,parmlist,varyList,constrDict,fixedList,parmDict=None,SeqHist=None): 514 514 '''Takes a list of relationship entries comprising a group of 515 515 constraints and builds the relationship lists and their inverse … … 535 535 floats, float values or None if the constraint defines a new parameter. 536 536 537 :param dict constrDict: a list of dicts defining relationships/constraints. 538 537 :param dict parmDict: a dict containing all parameters defined in current 538 refinement. 539 540 :param int SeqHist: number of current histogram, when used in a sequential 541 refinement. None (default) otherwise. Wildcard variable names are 542 set to the current histogram, when found if not None. 539 543 ''' 540 544 global dependentParmList,arrayList,invarrayList,indParmList,consNum … … 630 634 for var in constrDict[rel]: 631 635 if var.startswith('_'): continue 636 if var.split(':')[1] == '*' and SeqHist is not None: 637 # convert wildcard var to current histogram 638 sv = var.split(':') 639 sv[1] = str(SeqHist) 640 var = ':'.join(sv) 632 641 if parmDict is not None and var not in parmDict: 633 642 unused += 1 … … 673 682 unused = 0 674 683 for var in VarKeys(constrDict[rel]): 684 if var.split(':')[1] == '*' and SeqHist is not None: 685 # convert wildcard var to current histogram 686 sv = var.split(':') 687 sv[1] = str(SeqHist) 688 var = ':'.join(sv) 675 689 if parmDict is not None and var not in parmDict: 676 690 unused += 1
Note: See TracChangeset
for help on using the changeset viewer.