Changes in / [c7062fe:228cbd3] in sasmodels


Ignore:
Files:
1 deleted
38 edited

Legend:

Unmodified
Added
Removed
  • doc/Makefile

    r63776d3 r7bb290c  
    131131pdf: latex 
    132132        $(MAKE) -C _build/latex all-pdf 
    133         $(COPY) _build/latex/SASModels.pdf _build/html 
    134133 
    135134changes: 
  • doc/genmodel.py

    r70bbb74 r91c5fdc  
    1 import sys, os, math, re 
    2 import numpy as np 
    3 import matplotlib.pyplot as plt 
     1import sys, os 
    42sys.path.insert(0, os.path.abspath('..')) 
    53from sasmodels import generate, core 
    6 from sasmodels.direct_model import DirectModel 
    7 from sasmodels.data import empty_data1D, empty_data2D 
    8  
    94 
    105# Convert ../sasmodels/models/name.py to name 
     
    138# Load the doc string from the module definition file and store it in rst 
    149docstr = generate.make_doc(core.load_model_info(model_name)) 
    15      
    16 # Generate automatically plot of the model and add it to rst documentation 
    17  
    18 info = core.load_model_info(model_name) 
    19  
    20 # Calculate 1D curve for default parameters 
    21 pars = dict((p[0], p[2]) for p in info['parameters']) 
    22  
    23 # Plotting ranges and options 
    24 opts = { 
    25         'xscale'    : 'log', 
    26         'yscale'    : 'log' if not info['structure_factor'] else 'linear', 
    27         'qmin'      : 0.005, 
    28         'qmax'      : 1.0, 
    29         'nq'        : 1000, 
    30         'nq2d'      : 100, 
    31 } 
    32  
    33 qmin, qmax, nq = opts['qmin'], opts['qmax'], opts['nq'] 
    34 qmin = math.log10(qmin) 
    35 qmax = math.log10(qmax) 
    36 q = np.logspace(qmin, qmax, nq) 
    37 data = empty_data1D(q) 
    38 model = core.load_model(model_name) 
    39 calculator = DirectModel(data, model) 
    40 Iq1D = calculator() 
    41  
    42 # TO DO: Generation of 2D plots  
    43 # Problem in sasmodels.direct_model._calc_theory 
    44 # There self._kernel.q_input.nq  gets a value of 0 in the 2D case 
    45 # and returns a 0 numpy array (it does not call the C code) 
    46  
    47 # If 2D model, compute 2D image 
    48 #if info['has_2d'] != []: 
    49 #    qmax, nq2d = opts['qmax'], opts['nq2d'] 
    50 #    data2d = empty_data2D(np.linspace(-qmax, qmax, nq2d), resolution=0.0)  
    51 #    #model = core.load_model(model_name) 
    52 #    calculator = DirectModel(data2d, model) 
    53 #    Iq2D = calculator() 
    54  
    55 # Generate image (comment IF for 1D/2D for the moment) and generate only 1D 
    56 #if info['has_2d'] == []: 
    57 #    fig = plt.figure() 
    58 #    ax = fig.add_subplot(1,1,1) 
    59 #    ax.plot(q, Iq1D, color='blue', lw=2, label=model_name) 
    60 #    ax.set_xlabel(r'$Q \/(\AA^{-1})$') 
    61 #    ax.set_xscale(opts['xscale'])    
    62 #    ax.set_ylabel(r'$I(Q) \/(\mathrm{cm}^{-1})$') 
    63 #    ax.set_yscale(opts['yscale'])   
    64 #    ax.legend() 
    65 #else: 
    66 #    # need figure with 1D + 2D 
    67 #    pass 
    68 fig = plt.figure() 
    69 ax = fig.add_subplot(1,1,1) 
    70 ax.plot(q, Iq1D, color='blue', lw=2, label=model_name) 
    71 ax.set_xlabel(r'$Q \/(\AA^{-1})$') 
    72 ax.set_xscale(opts['xscale'])    
    73 ax.set_ylabel(r'$I(Q) \/(\mathrm{cm}^{-1})$') 
    74 ax.set_yscale(opts['yscale'])   
    75 ax.legend() 
    76   
    77  
    78 # Save image in model/img 
    79 figname = model_name + '_autogenfig.png' 
    80 filename = os.path.join('model', 'img', figname) 
    81 plt.savefig(filename) 
    82  
    83 # Auto caption for figure 
    84 captionstr = '\n' 
    85 captionstr += '.. figure:: img/' + model_name + '_autogenfig.png\n' 
    86 captionstr += '\n' 
    87 #if info['has_2d'] == []: 
    88 #    captionstr += '    1D plot corresponding to the default parameters of the model.\n' 
    89 #else: 
    90 #    captionstr += '    1D and 2D plots corresponding to the default parameters of the model.\n' 
    91 captionstr += '    1D plot corresponding to the default parameters of the model.\n' 
    92 captionstr += '\n' 
    93  
    94 # Add figure reference and caption to documentation (at end, before References) 
    95 pattern = '\*\*REFERENCE' 
    96 m = re.search(pattern, docstr.upper()) 
    97  
    98 if m: 
    99     docstr1 = docstr[:m.start()] 
    100     docstr2 = docstr[m.start():] 
    101     docstr = docstr1 + captionstr + docstr2 
    102 else: 
    103     print 'References NOT FOUND for model: ', model_name 
    104     docstr = docstr + captionstr 
    105  
    10610open(sys.argv[2],'w').write(docstr) 
  • sasmodels/bumps_model.py

    rc5dadbb r190fc2b  
    8383    pars = {} 
    8484    for p in model_info['parameters']: 
    85         value = kwargs.pop(p.name, p.default) 
    86         pars[p.name] = Parameter.default(value, name=p.name, limits=p.limits) 
     85        name, default, limits = p[0], p[2], p[3] 
     86        value = kwargs.pop(name, default) 
     87        pars[name] = Parameter.default(value, name=name, limits=limits) 
    8788    for name in model_info['partype']['pd-2d']: 
    8889        for xpart, xdefault, xlimits in [ 
    89                 ('_pd', 0., pars[name].limits), 
     90                ('_pd', 0., limits), 
    9091                ('_pd_n', 35., (0, 1000)), 
    9192                ('_pd_nsigma', 3., (0, 10)), 
  • sasmodels/compare.py

    rfcd7bbd r91c5fdc  
    681681    """ 
    682682    # Get the default values for the parameters 
    683     pars = dict((p.name, p.default) for p in model_info['parameters']) 
     683    pars = dict((p[0], p[2]) for p in model_info['parameters']) 
    684684 
    685685    # Fill in default values for the polydispersity parameters 
    686686    for p in model_info['parameters']: 
    687         if p.type in ('volume', 'orientation'): 
    688             pars[p.name+'_pd'] = 0.0 
    689             pars[p.name+'_pd_n'] = 0 
    690             pars[p.name+'_pd_nsigma'] = 3.0 
    691             pars[p.name+'_pd_type'] = "gaussian" 
     687        if p[4] in ('volume', 'orientation'): 
     688            pars[p[0]+'_pd'] = 0.0 
     689            pars[p[0]+'_pd_n'] = 0 
     690            pars[p[0]+'_pd_nsigma'] = 3.0 
     691            pars[p[0]+'_pd_type'] = "gaussian" 
    692692 
    693693    # Plug in values given in demo 
     
    833833        pars = suppress_pd(pars) 
    834834    pars.update(presets)  # set value after random to control value 
    835     #import pprint; pprint.pprint(model_info) 
    836835    constrain_pars(model_info, pars) 
    837836    constrain_new_to_old(model_info, pars) 
  • sasmodels/generate.py

    rfcd7bbd r2f0c07d  
    8080    is selected, or when an initial value is not otherwise specified. 
    8181 
    82     *limits = [lb, ub]* are the hard limits on the parameter value, used to 
    83     limit the polydispersity density function.  In the fit, the parameter limits 
     82    [*lb*, *ub*] are the hard limits on the parameter value, used to limit 
     83    the polydispersity density function.  In the fit, the parameter limits 
    8484    given to the fit are the limits  on the central value of the parameter. 
    8585    If there is polydispersity, it will evaluate parameter values outside 
     
    216216import re 
    217217import string 
    218 from collections import namedtuple 
    219218 
    220219import numpy as np 
    221  
    222 PARAMETER_FIELDS = ['name', 'units', 'default', 'limits', 'type', 'description'] 
    223 Parameter = namedtuple('Parameter', PARAMETER_FIELDS) 
    224220 
    225221#TODO: determine which functions are useful outside of generate 
     
    297293    """ 
    298294    column_widths = [ 
    299         max(len(p.name) for p in pars), 
    300         max(len(p.description) for p in pars), 
    301         max(len(format_units(p.units)) for p in pars), 
     295        max(len(p[0]) for p in pars), 
     296        max(len(p[-1]) for p in pars), 
     297        max(len(format_units(p[1])) for p in pars), 
    302298        PARTABLE_VALUE_WIDTH, 
    303299        ] 
     
    314310    for p in pars: 
    315311        lines.append(" ".join([ 
    316             "%-*s" % (column_widths[0], p.name), 
    317             "%-*s" % (column_widths[1], p.description), 
    318             "%-*s" % (column_widths[2], format_units(p.units)), 
    319             "%*g" % (column_widths[3], p.default), 
     312            "%-*s" % (column_widths[0], p[0]), 
     313            "%-*s" % (column_widths[1], p[-1]), 
     314            "%-*s" % (column_widths[2], format_units(p[1])), 
     315            "%*g" % (column_widths[3], p[2]), 
    320316            ])) 
    321317    lines.append(sep) 
     
    473469    fixed_2d = partype['fixed-1d'] 
    474470 
    475     iq_parameters = [p.name 
     471    iq_parameters = [p[0] 
    476472                     for p in model_info['parameters'][2:]  # skip scale, background 
    477                      if p.name in set(fixed_1d + pd_1d)] 
    478     iqxy_parameters = [p.name 
     473                     if p[0] in set(fixed_1d + pd_1d)] 
     474    iqxy_parameters = [p[0] 
    479475                       for p in model_info['parameters'][2:]  # skip scale, background 
    480                        if p.name in set(fixed_2d + pd_2d)] 
    481     volume_parameters = [p.name 
     476                       if p[0] in set(fixed_2d + pd_2d)] 
     477    volume_parameters = [p[0] 
    482478                         for p in model_info['parameters'] 
    483                          if p.type == 'volume'] 
     479                         if p[4] == 'volume'] 
    484480 
    485481    # Fill in defintions for volume parameters 
     
    610606 
    611607    for p in pars: 
    612         if p.type == 'volume': 
    613             partype['pd-1d'].append(p.name) 
    614             partype['pd-2d'].append(p.name) 
    615             partype['pd-rel'].add(p.name) 
    616         elif p.type == 'magnetic': 
    617             partype['fixed-2d'].append(p.name) 
    618         elif p.type == 'orientation': 
    619             partype['pd-2d'].append(p.name) 
    620         elif p.type == '': 
    621             partype['fixed-1d'].append(p.name) 
    622             partype['fixed-2d'].append(p.name) 
     608        name, ptype = p[0], p[4] 
     609        if ptype == 'volume': 
     610            partype['pd-1d'].append(name) 
     611            partype['pd-2d'].append(name) 
     612            partype['pd-rel'].add(name) 
     613        elif ptype == 'magnetic': 
     614            partype['fixed-2d'].append(name) 
     615        elif ptype == 'orientation': 
     616            partype['pd-2d'].append(name) 
     617        elif ptype == '': 
     618            partype['fixed-1d'].append(name) 
     619            partype['fixed-2d'].append(name) 
    623620        else: 
    624             raise ValueError("unknown parameter type %r" % p.type) 
    625         partype[p.type].append(p.name) 
     621            raise ValueError("unknown parameter type %r" % ptype) 
     622        partype[ptype].append(name) 
    626623 
    627624    return partype 
     
    631628    Process parameter block, precalculating parameter details. 
    632629    """ 
    633     # convert parameters into named tuples 
    634     pars = [Parameter(*p) for p in model_info['parameters']] 
    635630    # Fill in the derived attributes 
    636     model_info['parameters'] = pars 
    637     partype = categorize_parameters(pars) 
    638     model_info['limits'] = dict((p.name, p.limits) for p in pars) 
     631    partype = categorize_parameters(model_info['parameters']) 
     632    model_info['limits'] = dict((p[0], p[3]) for p in model_info['parameters']) 
    639633    model_info['partype'] = partype 
    640     model_info['defaults'] = dict((p.name, p.default) for p in pars) 
     634    model_info['defaults'] = dict((p[0], p[2]) for p in model_info['parameters']) 
    641635    if model_info.get('demo', None) is None: 
    642636        model_info['demo'] = model_info['defaults'] 
     
    655649    * *id* is the id of the kernel 
    656650    * *name* is the display name of the kernel 
    657     * *filename* is the full path to the module defining the file (if any) 
    658651    * *title* is a short description of the kernel 
    659652    * *description* is a long description of the kernel (this doesn't seem 
  • sasmodels/kernelpy.py

    rfcd7bbd r17bbadd  
    111111 
    112112        # First two fixed pars are scale and background 
    113         pars = [p.name for p in model_info['parameters'][2:]] 
     113        pars = [p[0] for p in model_info['parameters'][2:]] 
    114114        offset = len(self.q_input.q_vectors) 
    115115        self.args = self.q_input.q_vectors + [None] * len(pars) 
  • sasmodels/list_pars.py

    rfcd7bbd r17bbadd  
    2626        model_info = load_model_info(name) 
    2727        for p in model_info['parameters']: 
    28             partable.setdefault(p.name, []) 
    29             partable[p.name].append(name) 
     28            pname = p[0] 
     29            partable.setdefault(pname, []) 
     30            partable[pname].append(name) 
    3031    return partable 
    3132 
  • sasmodels/model_test.py

    rfcd7bbd r17bbadd  
    251251  python -m sasmodels.model_test [-v] [opencl|dll] model1 model2 ... 
    252252 
    253 If -v is included on the command line, then use verboe output. 
    254  
     253If -v is included on the 
    255254If neither opencl nor dll is specified, then models will be tested with 
    256255both opencl and dll; the compute target is ignored for pure python models. 
  • sasmodels/models/be_polyelectrolyte.py

    r6dd90c1 r2f0c07d  
    170170      'ionization_degree':      2.0, 
    171171      'polymer_concentration': 10.0, 
    172       'background':             0.0, 
    173172     }, 0.1, -3.75693800588], 
    174173 
     
    190189      'ionization_degree':     0.5, 
    191190      'polymer_concentration': 0.1, 
    192       'background':             0.0, 
    193191     }, 200., 1.80664667511e-06], 
    194192    ] 
  • sasmodels/models/core_shell_parallelepiped.py

    r6dd90c1 r2f0c07d  
    186186 
    187187qx, qy = 0.2 * np.cos(2.5), 0.2 * np.sin(2.5) 
    188 tests = [[{}, 0.2, 0.533149288477], 
    189          [{}, [0.2], [0.533149288477]], 
    190          [{'theta':10.0, 'phi':10.0}, (qx, qy), 0.032102135569], 
    191          [{'theta':10.0, 'phi':10.0}, [(qx, qy)], [0.032102135569]], 
     188tests = [[{}, 0.2, 0.532149288477], 
     189         [{}, [0.2], [0.532149288477]], 
     190         [{'theta':10.0, 'phi':10.0}, (qx, qy), 0.031102135569], 
     191         [{'theta':10.0, 'phi':10.0}, [(qx, qy)], [0.031102135569]], 
    192192        ] 
    193193del qx, qy  # not necessary to delete, but cleaner 
  • sasmodels/models/correlation_length.py

    r6dd90c1 r3e6c5c1  
    8484 
    8585tests = [[{}, 0.001, 1009.98], 
    86          [{}, 0.150141, 0.175645], 
    87          [{}, 0.442528, 0.0213957]] 
     86         [{}, 0.150141, 0.174645], 
     87         [{}, 0.442528, 0.0203957]] 
  • sasmodels/models/cylinder.py

    r6dd90c1 r2f0c07d  
    167167 
    168168qx, qy = 0.2 * np.cos(2.5), 0.2 * np.sin(2.5) 
    169 tests = [[{}, 0.2, 0.042761386790780453], 
    170          [{}, [0.2], [0.042761386790780453]], 
    171          [{'theta':10.0, 'phi':10.0}, (qx, qy), 0.03514647218513852], 
    172          [{'theta':10.0, 'phi':10.0}, [(qx, qy)], [0.03514647218513852]], 
     169tests = [[{}, 0.2, 0.041761386790780453], 
     170         [{}, [0.2], [0.041761386790780453]], 
     171         [{'theta':10.0, 'phi':10.0}, (qx, qy), 0.03414647218513852], 
     172         [{'theta':10.0, 'phi':10.0}, [(qx, qy)], [0.03414647218513852]], 
    173173        ] 
    174174del qx, qy  # not necessary to delete, but cleaner 
  • sasmodels/models/gauss_lorentz_gel.py

    r6dd90c1 r168052c  
    132132      'lorentz_scale_factor': 50.0, 
    133133      'dynamic_cor_length':   20.0, 
    134      }, 0.001, 149.482], 
     134     }, 0.001, 149.481], 
    135135 
    136136    [{'gauss_scale_factor':  100.0, 
     
    138138      'lorentz_scale_factor': 50.0, 
    139139      'dynamic_cor_length':   20.0, 
    140      }, 0.105363, 9.1913], 
     140     }, 0.105363, 9.1903], 
    141141 
    142142    [{'gauss_scale_factor':  100.0, 
     
    144144      'lorentz_scale_factor': 50.0, 
    145145      'dynamic_cor_length':   20.0, 
    146      }, 0.441623, 0.633811], 
     146     }, 0.441623, 0.632811], 
    147147 
    148148    # Additional tests with larger range of parameters 
     
    151151      'lorentz_scale_factor': 3.0, 
    152152      'dynamic_cor_length':   1.0, 
    153      }, 0.1, 2.9712970297], 
     153     }, 0.1, 2.9702970297], 
    154154 
    155155    [{'gauss_scale_factor':  10.0, 
     
    158158      'dynamic_cor_length':   1.0, 
    159159      'background':         100.0 
    160      }, 5.0, 100.116384615], 
     160     }, 5.0, 100.115384615], 
    161161 
    162162    [{'gauss_scale_factor':  10.0, 
     
    164164      'lorentz_scale_factor': 3.0, 
    165165      'dynamic_cor_length':   1.0, 
    166       'background':           0.0, 
    167166     }, 200., 7.49981250469e-05], 
    168167    ] 
  • sasmodels/models/gel_fit.py

    r6dd90c1 r5111921  
    9292           'gyration_radius': 10.0, 
    9393           'fractal_exp': 10.0, 
    94            'cor_length': 20.0, 
    95            'background': 0.0, 
     94           'cor_length': 20.0 
    9695          }, 0.1, 0.716532], 
    9796 
  • sasmodels/models/guinier.py

    r6dd90c1 r723cebe  
    5757 
    5858# parameters for unit tests 
    59 tests = [[{'rg' : 31.5}, 0.005, 0.992756]] 
     59tests = [[{'rg' : 31.5}, 0.005, 0.991756]] 
  • sasmodels/models/hardsphere.py

    rd529d93 r8e45182  
    33spherical particles interacting through hard sphere (excluded volume) 
    44interactions. 
    5 May be a reasonable approximation for other shapes of particles that  
    6 freely rotate, and for moderately polydisperse systems. Though strictly  
    7 the maths needs to be modified (no \Beta(Q) correction yet in sasview). 
    85 
    9 radius_effective is the effective hard sphere radius. 
    10 volfraction is the volume fraction occupied by the spheres. 
    11  
    12 In sasview the effective radius may be calculated from the parameters 
    13 used in the form factor $P(q)$ that this $S(q)$ is combined with. 
    14  
    15 For numerical stability the computation uses a Taylor series expansion  
    16 at very small $qR$, there may be a very minor glitch at the transition point 
    17 in some circumstances. 
    18  
    19 The S(Q) uses the Percus-Yevick closure where the interparticle 
     6The calculation uses the Percus-Yevick closure where the interparticle 
    207potential is 
    218 
     
    5744        systems. Though strictly the maths needs to be modified - 
    5845    which sasview does not do yet. 
    59     radius_effective is the hard sphere radius 
     46    effect_radius is the hard sphere radius 
    6047    volfraction is the volume fraction occupied by the spheres. 
    6148""" 
     
    6451 
    6552#             ["name", "units", default, [lower, upper], "type","description"], 
    66 parameters = [["radius_effective", "Ang", 50.0, [0, inf], "volume", 
     53parameters = [["effect_radius", "Ang", 50.0, [0, inf], "volume", 
    6754               "effective radius of hard sphere"], 
    6855              ["volfraction", "", 0.2, [0, 0.74], "", 
     
    7966      double D,A,B,G,X,X2,X4,S,C,FF,HARDSPH; 
    8067 
    81       if(fabs(radius_effective) < 1.E-12) { 
     68      if(fabs(effect_radius) < 1.E-12) { 
    8269               HARDSPH=1.0; 
    8370               return(HARDSPH); 
     
    8875      A= (1.+2.*volfraction)*D; 
    8976      A *=A; 
    90       X=fabs(q*radius_effective*2.0); 
     77      X=fabs(q*effect_radius*2.0); 
    9178 
    9279      if(X < 5.E-06) { 
     
    151138# VR defaults to 1.0 
    152139 
    153 demo = dict(radius_effective=200, volfraction=0.2, radius_effective_pd=0.1, radius_effective_pd_n=40) 
     140demo = dict(effect_radius=200, volfraction=0.2, effect_radius_pd=0.1, effect_radius_pd_n=40) 
    154141oldname = 'HardsphereStructure' 
    155 oldpars = dict(radius_effective="effect_radius",radius_effective_pd="effect_radius_pd",radius_effective_pd_n="effect_radius_pd_n") 
     142oldpars = dict() 
    156143# Q=0.001 is in the Taylor series, low Q part, so add Q=0.1, assuming double precision sasview is correct 
    157144tests = [ 
    158         [ {'scale': 1.0, 'background' : 0.0, 'radius_effective' : 50.0, 'volfraction' : 0.2, 
    159            'radius_effective_pd' : 0}, [0.001,0.1], [0.209128,0.930587]] 
     145        [ {'scale': 1.0, 'background' : 0.0, 'effect_radius' : 50.0, 'volfraction' : 0.2, 
     146           'effect_radius_pd' : 0}, [0.001,0.1], [0.209128,0.930587]] 
    160147        ] 
    161 # ADDED by: RKH  ON: 16Mar2016  using equations from FISH as better than orig sasview, see notes above. Added Taylor expansions at small Q,  
     148 
  • sasmodels/models/hayter_msa.py

    rd529d93 r348557a  
    99 
    1010**This routine only works for charged particles**. If the charge is set to 
    11 zero the routine may self-destruct! For non-charged particles use a hard 
     11zero the routine will self-destruct! For non-charged particles use a hard 
    1212sphere potential. 
    1313 
     
    1515which in turn is used to compute the Debye screening length. At present 
    1616there is no provision for entering the ionic strength directly nor for use 
    17 of any multivalent salts, though it should be possible to simulate the effect 
    18 of this by increasing the salt concentration. The counterions are also assumed to  
    19 be monovalent. 
    20  
    21 In sasview the effective radius may be calculated from the parameters 
    22 used in the form factor $P(q)$ that this $S(q)$ is combined with. 
    23  
    24 The computation uses a Taylor series expansion at very small rescaled $qR$, to  
    25 avoid some serious rounding error issues, this may result in a minor artefact  
    26 in the transition region under some circumstances. 
     17of any multivalent salts. The counterions are also assumed to be monovalent. 
    2718 
    2819For 2D data, the scattering intensity is calculated in the same way as 1D, 
     
    3324    q = \sqrt{q_x^2 + q_y^2} 
    3425 
     26.. figure:: img/HayterMSAsq_227.jpg 
     27 
     28    1D plot using the default values (in linear scale). 
    3529 
    3630References 
     
    4135J P Hansen and J B Hayter, *Molecular Physics*, 46 (1982) 651-656 
    4236""" 
    43 from numpy import inf 
    4437 
    45 category = "structure-factor" 
    46 structure_factor = True 
    47 single = False  # double precision only! 
    48  
    49 #  dp[0] = 2.0*radius_effective(); 
     38#  dp[0] = 2.0*effect_radius(); 
    5039#  dp[1] = fabs(charge()); 
    5140#  dp[2] = volfraction(); 
     
    5443#  dp[5] = dielectconst(); 
    5544 
     45from numpy import inf 
    5646 
    57  
     47source = ["hayter_msa_kernel.c"] 
    5848 
    5949name = "hayter_msa" 
    60 title = "Hayter-Penfold rescaled MSA, charged sphere, interparticle S(Q) structure factor" 
     50title = "Hayter-Penfold MSA charged sphere interparticle S(Q) structure factor" 
    6151description = """\ 
    62     [Hayter-Penfold RMSA charged sphere interparticle S(Q) structure factor] 
     52    [Hayter-Penfold MSA charged sphere interparticle S(Q) structure factor] 
    6353        Interparticle structure factor S(Q)for a charged hard spheres. 
    6454        Routine takes absolute value of charge, use HardSphere if charge 
    6555        goes to zero. 
    66         In sasview the effective radius and volume fraction may be calculated  
    67         from the parameters used in P(Q). 
     56        In sasview the effective radius will be calculated from the 
     57        parameters used in P(Q). 
    6858""" 
    69  
     59single = False  # double precision only! 
    7060 
    7161# pylint: disable=bad-whitespace, line-too-long 
    7262#             [ "name", "units", default, [lower, upper], "type", "description" ], 
    7363parameters = [ 
    74     ["radius_effective", "Ang", 20.75,   [0, inf],    "volume", "effective radius of charged sphere"], 
     64    ["effect_radius", "Ang", 20.75,   [0, inf],    "volume", "effective radius of hard sphere"], 
    7565    ["charge",        "e",   19.0,    [0, inf],    "", "charge on sphere (in electrons)"], 
    76     ["volfraction",   "None",     0.0192, [0, 0.74],   "", "volume fraction of spheres"], 
     66    ["volfraction",   "",     0.0192, [0, 0.74],   "", "volume fraction of spheres"], 
    7767    ["temperature",   "K",  318.16,   [0, inf],    "", "temperature, in Kelvin, for Debye length calculation"], 
    78     ["saltconc",      "M",    0.0,    [-inf, inf], "", "conc of salt, moles/litre, 1:1 electolyte, for Debye length"], 
    79     ["dielectconst",  "None",    71.08,   [-inf, inf], "", "dielectric constant (relative permittivity) of solvent, default water, for Debye length"] 
     68    ["saltconc",      "M",    0.0,    [-inf, inf], "", "conc of salt, 1:1 electolyte, for Debye length"], 
     69    ["dielectconst",  "",    71.08,   [-inf, inf], "", "dielectric constant of solvent (default water), for Debye length"], 
    8070    ] 
    8171# pylint: enable=bad-whitespace, line-too-long 
     72category = "structure-factor" 
    8273 
    83 source = ["hayter_msa_kernel.c"] 
    8474# No volume normalization despite having a volume parameter 
    8575# This should perhaps be volume normalized? 
     
    9585 
    9686oldname = 'HayterMSAStructure' 
    97 #oldpars = dict(effect_radius="radius_effective",effect_radius_pd="radius_effective_pd",effect_radius_pd_n="radius_effective_pd_n") 
    98 oldpars = dict(radius_effective="effect_radius",radius_effective_pd="effect_radius_pd",radius_effective_pd_n="effect_radius_pd_n") 
    99 #oldpars = dict( ) 
     87oldpars = dict() 
    10088# default parameter set,  use  compare.sh -midQ -linear 
    10189# note the calculation varies in different limiting cases so a wide range of 
    10290# parameters will be required for a thorough test! 
    10391# odd that the default st has saltconc zero 
    104 demo = dict(radius_effective=20.75, 
     92demo = dict(effect_radius=20.75, 
    10593            charge=19.0, 
    10694            volfraction=0.0192, 
     
    10896            saltconc=0.05, 
    10997            dielectconst=71.08, 
    110             radius_effective_pd=0.1, 
    111             radius_effective_pd_n=40) 
     98            effect_radius_pd=0.1, 
     99            effect_radius_pd_n=40) 
    112100# 
    113101# attempt to use same values as old sasview unit test at Q=.001 was 0.0712928,  
     
    116104    [{'scale': 1.0, 
    117105      'background': 0.0, 
    118       'radius_effective': 20.75, 
     106      'effect_radius': 20.75, 
    119107      'charge': 19.0, 
    120108      'volfraction': 0.0192, 
     
    122110      'saltconc': 0, 
    123111      'dielectconst': 78.0, 
    124       'radius_effective_pd': 0}, 
     112      'effect_radius_pd': 0}, 
    125113     [0.00001,0.0010,0.01,0.075], [0.0711646,0.0712928,0.0847006,1.07150]], 
    126114    [{'scale': 1.0, 
    127115      'background': 0.0, 
    128       'radius_effective': 20.75, 
     116      'effect_radius': 20.75, 
    129117      'charge': 19.0, 
    130118      'volfraction': 0.0192, 
     
    132120      'saltconc': 0.05, 
    133121      'dielectconst': 78.0, 
    134       'radius_effective_pd': 0.1, 
    135       'radius_effective_pd_n': 40}, 
     122      'effect_radius_pd': 0.1, 
     123      'effect_radius_pd_n': 40}, 
    136124     [0.00001,0.0010,0.01,0.075], [0.450272,0.450420,0.465116,1.039625]] 
    137125    ] 
    138 # ADDED by:  RKH  ON: 16Mar2016 converted from sasview, new Taylor expansion at smallest rescaled Q 
     126 
  • sasmodels/models/hayter_msa_kernel.c

    rd529d93 r348557a  
    33// C99 needs declarations of routines here 
    44double Iq(double QQ, 
    5       double radius_effective, double zz, double VolFrac, double Temp, double csalt, double dialec); 
     5      double effect_radius, double zz, double VolFrac, double Temp, double csalt, double dialec); 
    66int 
    77sqcoef(int ir, double gMSAWave[]); 
     
    1414   
    1515double Iq(double QQ, 
    16       double radius_effective, double zz, double VolFrac, double Temp, double csalt, double dialec)   
     16      double effect_radius, double zz, double VolFrac, double Temp, double csalt, double dialec)   
    1717{ 
    1818    double gMSAWave[17]={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17}; 
     
    2828        pi = M_PI; 
    2929 
    30         diam=2*radius_effective;                //in A 
     30        diam=2*effect_radius;           //in A 
    3131 
    3232                                                //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// 
  • sasmodels/models/hollow_rectangular_prism.py

    r6dd90c1 r5111921  
    158158               thickness='thickness', sld='sldPipe', solvent_sld='sldSolv') 
    159159 
    160 tests = [[{}, 0.2, 0.76687283098], 
    161          [{}, [0.2], [0.76687283098]], 
     160tests = [[{}, 0.2, 0.76587283098], 
     161         [{}, [0.2], [0.76587283098]], 
    162162        ] 
    163163 
  • sasmodels/models/hollow_rectangular_prism_infinitely_thin_walls.py

    r6dd90c1 rdeb7ee0  
    137137               sld='sldPipe', solvent_sld='sldSolv') 
    138138 
    139 tests = [[{}, 0.2, 0.837719188592], 
    140          [{}, [0.2], [0.837719188592]], 
     139tests = [[{}, 0.2, 0.836719188592], 
     140         [{}, [0.2], [0.836719188592]], 
    141141        ] 
    142142 
  • sasmodels/models/line.py

    r6dd90c1 rfa8011eb  
    8080    [{'intercept':   1.0, 
    8181      'slope': 1.0, 
    82      }, 1.0, 2.001], 
     82     }, 1.0, 2.0], 
    8383 
    8484    [{'intercept':   1.0, 
    8585      'slope': 1.0, 
    86      }, 0.0, 1.001], 
     86     }, 0.0, 1.0], 
    8787 
    8888    [{'intercept':   1.0, 
    8989      'slope': 1.0, 
    90      }, 0.4, 1.401], 
     90     }, 0.4, 1.4], 
    9191 
    9292    [{'intercept':   1.0, 
    9393      'slope': 1.0, 
    94      }, 1.3, 2.301], 
     94     }, 1.3, 2.3], 
    9595 
    9696    [{'intercept':   1.0, 
    9797      'slope': 1.0, 
    98      }, 0.5, 1.501], 
     98     }, 0.5, 1.5], 
    9999 
    100100    [{'intercept':   1.0, 
    101101      'slope': 1.0, 
    102      }, [0.4, 0.5], [1.401, 1.501]], 
     102     }, [0.4, 0.5], [1.4, 1.5]], 
    103103 
    104104    [{'intercept':   1.0, 
    105105      'slope': 1.0, 
    106       'background': 0.0, 
    107106     }, (1.3, 1.57), 5.911], 
    108107] 
  • sasmodels/models/lorentz.py

    r6dd90c1 reb5901b  
    6464 
    6565# parameters for unit tests 
    66 tests = [[{'cor_length': 250}, 0.01, 0.138931]] 
     66tests = [[{'cor_length': 250}, 0.01, 0.137931]] 
  • sasmodels/models/mass_fractal.py

    r6dd90c1 r168052c  
    106106      'mass_dim':        1.9, 
    107107      'cutoff_length': 100.0, 
    108      }, 0.05, 279.59422], 
     108     }, 0.05, 279.59322], 
    109109 
    110110    # Additional tests with larger range of parameters 
     
    112112      'mass_dim':      3.3, 
    113113      'cutoff_length': 1.0, 
    114      }, 0.5, 1.29116774904], 
     114     }, 0.5, 1.29016774904], 
    115115 
    116116    [{'radius':        1.0, 
     
    124124      'cutoff_length': 1.0, 
    125125      'scale':        10.0, 
    126      }, 0.051, 11.6237966145], 
     126     }, 0.051, 11.6227966145], 
    127127    ] 
  • sasmodels/models/mass_surface_fractal.py

    r6dd90c1 r168052c  
    115115      'cluster_rg':   86.7, 
    116116      'primary_rg': 4000.0, 
    117       'background':    0.0, 
    118117     }, 0.05, 1.77537e-05], 
    119118 
     
    123122      'cluster_rg':   90.0, 
    124123      'primary_rg': 4000.0, 
    125      }, 0.001, 0.18562699016], 
     124     }, 0.001, 0.18462699016], 
    126125 
    127126    [{'mass_dim':      1.3, 
     
    137136      'primary_rg': 1000.0, 
    138137      'scale':        10.0, 
    139       'background':    0.0, 
    140138     }, 0.051, 0.000169548800377], 
    141139    ] 
  • sasmodels/models/mono_gauss_coil.py

    r6dd90c1 r4c05f49  
    6161 
    6262# NB: Scale and Background are implicit parameters on every model 
    63 def Iq(q, i_zero, radius_gyration): 
     63def Iq(q, radius_gyration): 
    6464    # pylint: disable = missing-docstring 
    65     z = (q * radius_gyration) ** 2 
    66     if q == 0: 
     65    z = (x * radius_gyration) * (x * radius_gyration) 
     66    if x == 0: 
    6767       inten = 1.0 
    6868    else: 
    6969       inten = i_zero * 2.0 * (exp(-z) + z - 1.0 ) / (z * z) 
    7070    return inten 
    71 #Iq.vectorized = True # Iq accepts an array of q values 
     71Iq.vectorized =  True # Iq accepts an array of q values 
    7272 
    7373def Iqxy(qx, qy, *args): 
    7474    # pylint: disable = missing-docstring 
    7575    return Iq(sqrt(qx ** 2 + qy ** 2), *args) 
    76 #Iqxy.vectorized = True # Iqxy accepts an array of qx, qy values 
     76Iqxy.vectorized = True # Iqxy accepts an array of qx, qy values 
    7777 
    7878demo =  dict(scale = 1.0, 
  • sasmodels/models/parallelepiped.py

    r6dd90c1 r5111921  
    233233 
    234234qx, qy = 0.2 * np.cos(2.5), 0.2 * np.sin(2.5) 
    235 tests = [[{}, 0.2, 0.17758004974], 
    236          [{}, [0.2], [0.17758004974]], 
    237          [{'theta':10.0, 'phi':10.0}, (qx, qy), 0.00560296014], 
    238          [{'theta':10.0, 'phi':10.0}, [(qx, qy)], [0.00560296014]], 
     235tests = [[{}, 0.2, 0.17658004974], 
     236         [{}, [0.2], [0.17658004974]], 
     237         [{'theta':10.0, 'phi':10.0}, (qx, qy), 0.00460296014], 
     238         [{'theta':10.0, 'phi':10.0}, [(qx, qy)], [0.00460296014]], 
    239239        ] 
    240240del qx, qy  # not necessary to delete, but cleaner 
  • sasmodels/models/poly_gauss_coil.py

    r6dd90c1 r4c05f49  
    6767 
    6868# NB: Scale and Background are implicit parameters on every model 
    69 def Iq(q, i_zero, radius_gyration, polydispersity): 
     69def Iq(q, radius_gyration, polydispersity): 
    7070    # pylint: disable = missing-docstring 
    71     u = polydispersity - 1.0 
     71        u = polydispersity - 1.0 
    7272    # TO DO 
    73     # should trap the case of polydispersity = 1 by switching to a taylor expansion 
    74     minusoneonu = -1.0 / u 
    75     z = (q * radius_gyration) ** 2 / (1.0 + 2.0 * u) 
    76     if q == 0: 
    77         inten = i_zero * 1.0 
    78     else: 
    79         inten = i_zero * 2.0 * (power((1.0 + u * z),minusoneonu) + z - 1.0 ) / ((1.0 + u) * (z * z)) 
    80     return inten 
    81 #Iq.vectorized = True # Iq accepts an array of q values 
     73        # should trap the case of polydispersity = 1 by switching to a taylor expansion 
     74        minusoneonu = -1.0 / u 
     75        z = ((x * radius_gyration) * (x * radius_gyration)) / (1.0 + 2.0 * u) 
     76        if x == 0: 
     77           inten = i_zero * 1.0 
     78        else: 
     79           inten = i_zero * 2.0 * (power((1.0 + u * z),minusoneonu) + z - 1.0 ) / ((1.0 + u) * (z * z)) 
     80        return inten 
     81Iq.vectorized =  True # Iq accepts an array of q values 
    8282 
    8383def Iqxy(qx, qy, *args): 
    8484    # pylint: disable = missing-docstring 
    8585    return Iq(sqrt(qx ** 2 + qy ** 2), *args) 
    86 #Iqxy.vectorized = True # Iqxy accepts an array of qx, qy values 
     86Iqxy.vectorized = True # Iqxy accepts an array of qx, qy values 
    8787 
    8888demo =  dict(scale = 1.0, 
  • sasmodels/models/polymer_excl_volume.py

    r6dd90c1 r168052c  
    168168tests = [ 
    169169    # Accuracy tests based on content in test/polyexclvol_default_igor.txt 
    170     [{'rg': 60, 'porod_exp': 3.0}, 0.001, 0.999801], 
    171     [{'rg': 60, 'porod_exp': 3.0}, 0.105363, 0.0172751], 
    172     [{'rg': 60, 'porod_exp': 3.0, 'background': 0.0}, 0.665075, 6.56261e-05], 
     170    [{'rg': 60, 'porod_exp': 3.0}, 0.001, 0.998801], 
     171    [{'rg': 60, 'porod_exp': 3.0}, 0.105363, 0.0162751], 
     172    [{'rg': 60, 'porod_exp': 3.0}, 0.665075, 6.56261e-05], 
    173173 
    174174    # Additional tests with larger range of parameters 
    175     [{'rg': 10, 'porod_exp': 4.0}, 0.1, 0.724436675809], 
     175    [{'rg': 10, 'porod_exp': 4.0}, 0.1, 0.723436675809], 
    176176    [{'rg': 2.2, 'porod_exp': 22.0, 'background': 100.0}, 5.0, 100.0], 
    177177    [{'rg': 1.1, 'porod_exp': 1, 'background': 10.0, 'scale': 1.25}, 
  • sasmodels/models/rectangular_prism.py

    r6dd90c1 rdeb7ee0  
    135135               sld='sldPipe', solvent_sld='sldSolv') 
    136136 
    137 tests = [[{}, 0.2, 0.375248406825], 
    138          [{}, [0.2], [0.375248406825]], 
     137tests = [[{}, 0.2, 0.374248406825], 
     138         [{}, [0.2], [0.374248406825]], 
    139139        ] 
  • sasmodels/models/sc_crystal.py

    r6dd90c1 r5111921  
    152152tests = [ 
    153153    # Accuracy tests based on content in test/utest_extra_models.py 
    154     [{}, 0.001, 10.3048], 
    155     [{}, 0.215268, 0.00814889], 
    156     [{}, (0.414467), 0.001313289] 
     154    [{}, 0.001, 10.3038], 
     155    [{}, 0.215268, 0.00714889], 
     156    [{}, (0.414467), 0.000313289] 
    157157    ] 
    158158 
  • sasmodels/models/squarewell.py

    rd529d93 r5111921  
    88Positive well depths correspond to an attractive potential well. Negative well depths correspond to a potential 
    99"shoulder", which may or may not be physically reasonable. The stickyhardsphere model may be a better choice in 
    10 some circumstances. Computed values may behave badly at extremely small $qR$. 
     10some circumstances. Computed values may behave badly at extremely small Q. 
    1111 
    12 The well width (|lambda| ) is defined as multiples of the particle diameter (2\*\ *R*\ ) 
     12The well width (*l*\ ) is defined as multiples of the particle diameter (2\*\ *R*\ ) 
    1313 
    1414The interaction potential is: 
     
    2222    U(r) = \begin{cases} 
    2323    \infty & r < 2R \\ 
    24     -\epsilon & 2R \leq r < 2R\lambda \\ 
    25     0 & r \geq 2R\lambda 
     24    -\epsilon , 2R \leq < 2R\lambda 
     25    0 & r \geq 2R 
    2626    \end{cases} 
    2727 
    2828where $r$ is the distance from the center of the sphere of a radius $R$. 
    2929 
    30 In sasview the effective radius may be calculated from the parameters 
    31 used in the form factor $P(q)$ that this $S(q)$ is combined with. 
    3230 
    3331For 2D data: The 2D scattering intensity is calculated in the same way as 1D, where the *q* vector is defined as 
     
    3735    q = \sqrt{q_x^2 + q_y^2} 
    3836 
     37.. comment:: 
     38 
     39  .. figure:: img/squarewell_226.jpg 
     40 
     41    1D plot using the default values (in linear scale).* 
    3942 
    4043REFERENCE 
     
    5659""" 
    5760category = "structure-factor" 
    58 structure_factor = True 
    5961 
    6062#single = False 
     
    6365    #   [ "name", "units", default, [lower, upper], "type", 
    6466    #     "description" ], 
    65     ["radius_effective", "Ang", 50.0, [0, inf], "volume", 
     67    ["effect_radius", "Ang", 50.0, [0, inf], "volume", 
    6668     "effective radius of hard sphere"], 
    6769    ["volfraction", "", 0.04, [0, 0.08], "", 
     
    6971    ["welldepth", "kT", 1.5, [0.0, 1.5], "", 
    7072     "depth of well, epsilon"], 
    71     ["wellwidth", "diameters", 1.2, [1.0, inf], "", 
    72      "width of well in diameters (=2R) units, must be > 1"], 
     73    ["wellwidth", "diameters", 1.2, [0, inf], "", 
     74     "width of well in diameters (=2R) units"], 
    7375    ] 
    7476 
     
    8789        x= q; 
    8890         
    89         req = radius_effective; 
     91        req = effect_radius; 
    9092        phis = volfraction; 
    9193        edibkb = welldepth; 
     
    132134 
    133135oldname = 'SquareWellStructure' 
    134 oldpars = dict(radius_effective="effect_radius",radius_effective_pd="effect_radius_pd",radius_effective_pd_n="effect_radius_pd_n") 
    135 demo = dict(radius_effective=50, volfraction=0.04, welldepth=1.5, 
    136             wellwidth=1.2, radius_effective_pd=0, radius_effective_pd_n=0) 
     136oldpars = dict() 
     137demo = dict(effect_radius=50, volfraction=0.04, welldepth=1.5, 
     138            wellwidth=1.2, effect_radius_pd=0, effect_radius_pd_n=0) 
    137139# 
    138140tests = [ 
    139         [ {'scale': 1.0, 'background' : 0.0, 'radius_effective' : 50.0, 'volfraction' : 0.04,'welldepth' : 1.5, 'wellwidth' : 1.2,  
    140            'radius_effective_pd' : 0}, [0.001], [0.97665742]] 
     141        [ {'scale': 1.0, 'background' : 0.0, 'effect_radius' : 50.0, 'volfraction' : 0.04,'welldepth' : 1.5, 'wellwidth' : 1.2,  
     142           'effect_radius_pd' : 0}, [0.001], [0.97665742]] 
    141143        ] 
    142 # ADDED by: converting from sasview RKH  ON: 16Mar2016 
     144# ADDED by: converting from sasview RKH  ON: 16Mar2016 - in progress 
    143145 
  • sasmodels/models/star_polymer.py

    r6dd90c1 r13ed84c  
    7676tests = [[{'radius2': 2.0, 
    7777           'arms':    3.3, 
    78           }, 0.5, 0.851646091108], 
     78          }, 0.5, 0.850646091108], 
    7979 
    8080         [{'radius2':    1.0, 
  • sasmodels/models/stickyhardsphere.py

    rd529d93 r8e45182  
    4949the optimization does not hit the constraints. 
    5050 
    51 In sasview the effective radius may be calculated from the parameters 
     51In sasview the effective radius will be calculated from the parameters 
    5252used in the form factor $P(q)$ that this $S(q)$ is combined with. 
    5353 
  • sasmodels/models/surface_fractal.py

    r6dd90c1 r168052c  
    106106      'surface_dim': 2.0, 
    107107      'cutoff_length': 500.0, 
    108      }, 0.05, 301428.66016], 
     108     }, 0.05, 301428.65916], 
    109109 
    110110    # Additional tests with larger range of parameters 
     
    112112      'surface_dim': 1.0, 
    113113      'cutoff_length': 10.0, 
    114      }, 0.332070182643, 1125.00421004], 
     114     }, 0.332070182643, 1125.00321004], 
    115115 
    116116    [{'radius': 3.5, 
     
    124124      'cutoff_length': 33.0, 
    125125      'scale': 0.1, 
    126      }, 0.51, 2.50120147004], 
     126     }, 0.51, 2.50020147004], 
    127127    ] 
  • sasmodels/models/teubner_strey.py

    r6dd90c1 reb69cce  
    9191oldpars = dict(a2='scale') 
    9292 
    93 tests = [[{}, 0.2, 0.145927536232]] 
     93tests = [[{}, 0.2, 0.144927536232]] 
  • sasmodels/models/vesicle.py

    r6dd90c1 rfa8011eb  
    130130 
    131131 
    132 # NOTE: test results taken from values returned by SasView 3.1.2, with 
    133 # 0.001 added for a non-zero default background. 
    134 tests = [[{}, 0.0010005303255, 17139.8278799], 
    135          [{}, 0.200027832249, 0.131387268704], 
     132# NOTE: test results taken from values returned by SasView 3.1.2 
     133tests = [[{}, 0.0010005303255, 17139.8268799], 
     134         [{}, 0.200027832249, 0.130387268704], 
    136135         [{}, 'ER', 130.], 
    137136         [{}, 'VR', 0.54483386436], 
  • sasmodels/product.py

    rfcd7bbd r35b4c47  
    2828    s_id, s_name, s_pars = s_info['id'], s_info['name'], s_info['parameters'] 
    2929    # We require models to start with scale and background 
    30     assert s_pars[SCALE].name == 'scale' 
    31     assert s_pars[BACKGROUND].name == 'background' 
     30    assert s_pars[SCALE][0] == 'scale' 
     31    assert s_pars[BACKGROUND][0] == 'background' 
    3232    # We require structure factors to start with effect radius and volfraction 
    33     assert s_pars[EFFECT_RADIUS].name == 'effect_radius' 
    34     assert s_pars[VOLFRACTION].name == 'volfraction' 
     33    assert s_pars[EFFECT_RADIUS][0] == 'effect_radius' 
     34    assert s_pars[VOLFRACTION][0] == 'volfraction' 
    3535    # Combine the parameter sets.  We are skipping the first three 
    3636    # parameters of S since scale, background are defined in P and 
     
    3838    pars = p_pars + s_pars[3:] 
    3939    # check for duplicates; can't use assertion since they may never be checked 
    40     if len(set(p.name for p in pars)) != len(pars): 
     40    if len(set(p[0] for p in pars)) != len(pars): 
    4141        raise ValueError("Duplicate parameters in %s and %s"%(p_id)) 
    4242    # For comparison with sasview, determine the old parameters. 
     
    5252    model_info['title'] = 'Product of %s and structure factor %s'%(p_name, s_name) 
    5353    model_info['description'] = model_info['title'] 
    54     model_info['docs'] = model_info['title'] 
    5554    model_info['category'] = "custom" 
    5655    model_info['parameters'] = pars 
    57     #model_info['single'] = p_info['single'] and s_info['single'] 
    58     model_info['structure_factor'] = False 
    59     model_info['variant_info'] = None 
    60     #model_info['tests'] = [] 
    61     #model_info['source'] = [] 
    62     # Iq, Iqxy, form_volume, ER, VR and sesans 
     56    # Remember the component info blocks so we can build the product model 
     57    model_info['composition'] = ('product', [p_info, s_info]) 
    6358    model_info['oldname'] = oldname 
    6459    model_info['oldpars'] = oldpars 
    65     model_info['composition'] = ('product', [p_info, s_info]) 
    6660    process_parameters(model_info) 
    6761    return model_info 
  • sasmodels/sasview_model.py

    rfcd7bbd r28da77d  
    6060        self.dispersion = dict() 
    6161        partype = model.info['partype'] 
    62         for p in model.info['parameters']: 
    63             self.params[p.name] = p.default 
    64             self.details[p.name] = [p.units] + p.limits 
     62        for name, units, default, limits, _, _ in model.info['parameters']: 
     63            self.params[name] = default 
     64            self.details[name] = [units] + limits 
    6565 
    6666        for name in partype['pd-2d']: 
Note: See TracChangeset for help on using the changeset viewer.