Changeset 5110


Ignore:
Timestamp:
Dec 6, 2021 4:56:47 PM (7 months ago)
Author:
toby
Message:

constraint comments

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/GSASIImapvars.py

    r5104 r5110  
    373373
    374374The output from :func:`ProcessConstraints` will have the form as below,
    375 where the first entry is a "Const", the second is a "New Var" and the final is a "Hold".
     375where the first entry is a "Const" and the second is a "New Var".
    376376
    377377  .. code-block:: python
     
    379379    constrDict = [
    380380         {'0:12:Scale': 2.0, '0:14:Scale': 4.0, '0:13:Scale': 3.0, '0:0:Scale': 0.5},
    381          {'2::C(10,6,1)': 1.0, '1::C(10,6,1)': 1.0, '_vary':True},
    382          {'0::A0': 0.0}]
    383     fixedList = ['5.0', None, '0']
     381         {'2::C(10,6,1)': 1.0, '1::C(10,6,1)': 1.0, '_vary':True}]
     382    fixedList = ['5.0', None]
    384383
    385384.. _GenerateConstraints:
     
    17291728
    17301729def SubfromParmDict(s,prmDict):
     1730    '''Process a string as a multiplier and convert it to a float value. This
     1731    is done by subsituting any GSAS-II parameter names that appear in the
     1732    string that have associated values in the parameter dict with the value
     1733    for that parameter.
     1734
     1735    :param str s: a string to be converted to a value
     1736    :param dict prmDict: a dictionary with keys as GSAS-II parameter names
     1737      and values the corresponding parameter value.
     1738    :returns: the evaluated expression as a float.
     1739    '''
     1740    # TODO: perhaps SubfromParmDict should be called to convert the
     1741    # fixed-val in constraint equations from strings to values.
    17311742    for key in prmDict:
    17321743        if key in s:
  • trunk/GSASIIobj.py

    r5104 r5110  
    7676
    7777  * <mult> is a multiplier for the constraint (float)
    78   * <var> a :class:`G2VarObj` object (previously a str variable name of form
    79       'p:h:name[:at]')
     78  * <var> a :class:`G2VarObj` object. (Note that in very old .gpx files this might be a str with a variable name of form 'p:h:name[:at]')
    8079
    8180Note that the last three items in the list play a special role:
Note: See TracChangeset for help on using the changeset viewer.