Changeset 6dd90c1 in sasmodels


Ignore:
Timestamp:
Mar 16, 2016 7:25:21 PM (8 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, costrafo411, magnetic_model, release_v0.94, release_v0.95, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
63776d3
Parents:
5111921
Message:

update model tests for default background of 0.001

Location:
sasmodels/models
Files:
23 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/be_polyelectrolyte.py

    r2f0c07d r6dd90c1  
    170170      'ionization_degree':      2.0, 
    171171      'polymer_concentration': 10.0, 
     172      'background':             0.0, 
    172173     }, 0.1, -3.75693800588], 
    173174 
     
    189190      'ionization_degree':     0.5, 
    190191      'polymer_concentration': 0.1, 
     192      'background':             0.0, 
    191193     }, 200., 1.80664667511e-06], 
    192194    ] 
  • sasmodels/models/core_shell_parallelepiped.py

    r2f0c07d r6dd90c1  
    186186 
    187187qx, qy = 0.2 * np.cos(2.5), 0.2 * np.sin(2.5) 
    188 tests = [[{}, 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]], 
     188tests = [[{}, 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]], 
    192192        ] 
    193193del qx, qy  # not necessary to delete, but cleaner 
  • sasmodels/models/correlation_length.py

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

    r2f0c07d r6dd90c1  
    167167 
    168168qx, qy = 0.2 * np.cos(2.5), 0.2 * np.sin(2.5) 
    169 tests = [[{}, 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]], 
     169tests = [[{}, 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]], 
    173173        ] 
    174174del qx, qy  # not necessary to delete, but cleaner 
  • sasmodels/models/gauss_lorentz_gel.py

    r168052c r6dd90c1  
    132132      'lorentz_scale_factor': 50.0, 
    133133      'dynamic_cor_length':   20.0, 
    134      }, 0.001, 149.481], 
     134     }, 0.001, 149.482], 
    135135 
    136136    [{'gauss_scale_factor':  100.0, 
     
    138138      'lorentz_scale_factor': 50.0, 
    139139      'dynamic_cor_length':   20.0, 
    140      }, 0.105363, 9.1903], 
     140     }, 0.105363, 9.1913], 
    141141 
    142142    [{'gauss_scale_factor':  100.0, 
     
    144144      'lorentz_scale_factor': 50.0, 
    145145      'dynamic_cor_length':   20.0, 
    146      }, 0.441623, 0.632811], 
     146     }, 0.441623, 0.633811], 
    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.9702970297], 
     153     }, 0.1, 2.9712970297], 
    154154 
    155155    [{'gauss_scale_factor':  10.0, 
     
    158158      'dynamic_cor_length':   1.0, 
    159159      'background':         100.0 
    160      }, 5.0, 100.115384615], 
     160     }, 5.0, 100.116384615], 
    161161 
    162162    [{'gauss_scale_factor':  10.0, 
     
    164164      'lorentz_scale_factor': 3.0, 
    165165      'dynamic_cor_length':   1.0, 
     166      'background':           0.0, 
    166167     }, 200., 7.49981250469e-05], 
    167168    ] 
  • sasmodels/models/gel_fit.py

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

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

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

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

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

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

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

    r168052c r6dd90c1  
    115115      'cluster_rg':   86.7, 
    116116      'primary_rg': 4000.0, 
     117      'background':    0.0, 
    117118     }, 0.05, 1.77537e-05], 
    118119 
     
    122123      'cluster_rg':   90.0, 
    123124      'primary_rg': 4000.0, 
    124      }, 0.001, 0.18462699016], 
     125     }, 0.001, 0.18562699016], 
    125126 
    126127    [{'mass_dim':      1.3, 
     
    136137      'primary_rg': 1000.0, 
    137138      'scale':        10.0, 
     139      'background':    0.0, 
    138140     }, 0.051, 0.000169548800377], 
    139141    ] 
  • sasmodels/models/mono_gauss_coil.py

    r4c05f49 r6dd90c1  
    6161 
    6262# NB: Scale and Background are implicit parameters on every model 
    63 def Iq(q, radius_gyration): 
     63def Iq(q, i_zero, radius_gyration): 
    6464    # pylint: disable = missing-docstring 
    65     z = (x * radius_gyration) * (x * radius_gyration) 
    66     if x == 0: 
     65    z = (q * radius_gyration) ** 2 
     66    if q == 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 
     71#Iq.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 
     76#Iqxy.vectorized = True # Iqxy accepts an array of qx, qy values 
    7777 
    7878demo =  dict(scale = 1.0, 
  • sasmodels/models/parallelepiped.py

    r5111921 r6dd90c1  
    233233 
    234234qx, qy = 0.2 * np.cos(2.5), 0.2 * np.sin(2.5) 
    235 tests = [[{}, 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]], 
     235tests = [[{}, 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]], 
    239239        ] 
    240240del qx, qy  # not necessary to delete, but cleaner 
  • sasmodels/models/poly_gauss_coil.py

    r4c05f49 r6dd90c1  
    6767 
    6868# NB: Scale and Background are implicit parameters on every model 
    69 def Iq(q, radius_gyration, polydispersity): 
     69def Iq(q, i_zero, 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 = ((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 
    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 = (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 
    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 
     86#Iqxy.vectorized = True # Iqxy accepts an array of qx, qy values 
    8787 
    8888demo =  dict(scale = 1.0, 
  • sasmodels/models/polymer_excl_volume.py

    r168052c r6dd90c1  
    168168tests = [ 
    169169    # Accuracy tests based on content in test/polyexclvol_default_igor.txt 
    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], 
     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], 
    173173 
    174174    # Additional tests with larger range of parameters 
    175     [{'rg': 10, 'porod_exp': 4.0}, 0.1, 0.723436675809], 
     175    [{'rg': 10, 'porod_exp': 4.0}, 0.1, 0.724436675809], 
    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

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

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

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

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

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

    rfa8011eb r6dd90c1  
    130130 
    131131 
    132 # NOTE: test results taken from values returned by SasView 3.1.2 
    133 tests = [[{}, 0.0010005303255, 17139.8268799], 
    134          [{}, 0.200027832249, 0.130387268704], 
     132# NOTE: test results taken from values returned by SasView 3.1.2, with 
     133# 0.001 added for a non-zero default background. 
     134tests = [[{}, 0.0010005303255, 17139.8278799], 
     135         [{}, 0.200027832249, 0.131387268704], 
    135136         [{}, 'ER', 130.], 
    136137         [{}, 'VR', 0.54483386436], 
Note: See TracChangeset for help on using the changeset viewer.