Changeset 50ec515 in sasmodels
- Timestamp:
- Aug 5, 2016 8:35:30 AM (8 years ago)
- 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:
- e187b25
- Parents:
- e7fe459
- Location:
- sasmodels
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/modelinfo.py
r9eb3632 r50ec515 101 101 limits = (float(low), float(high)) 102 102 except Exception: 103 print("user_limits",user_limits) 104 raise ValueError("invalid limits for %s"%name) 105 else: 106 if low >= high: 107 raise ValueError("require lower limit < upper limit") 103 raise ValueError("invalid limits for %s: %r"%(name,user_limits)) 104 if low >= high: 105 raise ValueError("require lower limit < upper limit") 108 106 109 107 # Process default value as float, making sure it is in range … … 281 279 15 degrees). 282 280 281 *choices* is the option names for a drop down list of options, as for 282 example, might be used to set the value of a shape parameter. 283 283 284 These values are set by :func:`make_parameter_table` and 284 285 :func:`parse_parameter` therein. … … 522 523 pk.polydisperse = p.polydisperse 523 524 pk.relative_pd = p.relative_pd 525 pk.choices = p.choices 524 526 full_list.append(pk) 525 527 -
sasmodels/models/spherical_sld.py
r4e0968b r50ec515 15 15 sub-shell is described by a line function, with *n_steps* sub-shells per 16 16 interface. The form factor is normalized by the total volume of the sphere. 17 18 Interface shapes are as follows:: 19 20 0: erf(|nu|*z) 21 1: Rpow(z^|nu|) 22 2: Lpow(z^|nu|) 23 3: Rexp(-|nu|z) 24 4: Lexp(-|nu|z) 17 25 18 26 Definition … … 186 194 category = "shape:sphere" 187 195 188 SHAPES = [ "erf(|nu|*z)", "Rpow(z^|nu|)", "Lpow(z^|nu|)",189 "Rexp(-|nu|z)", "Lexp(-|nu|z)"],196 SHAPES = [["erf(|nu|*z)", "Rpow(z^|nu|)", "Lpow(z^|nu|)", 197 "Rexp(-|nu|z)", "Lexp(-|nu|z)"]] 190 198 191 199 # pylint: disable=bad-whitespace, line-too-long … … 234 242 sld_l = sld[i] 235 243 sld_r = sld[i+1] if i < n_shells-1 else sld_solvent 236 interface = SHAPE_FUNCTIONS[int(np.clip(shape[i], 0, len(SHAPES)-1))]244 fn = SHAPE_FUNCTIONS[int(np.clip(shape[i], 0, len(SHAPE_FUNCTIONS)-1))] 237 245 for step in range(1, n_steps+1): 238 portion = interface(float(step)/n_steps, max(abs(nu[i]), 1e-14))246 portion = fn(float(step)/n_steps, max(abs(nu[i]), 1e-14)) 239 247 z0 += dz 240 248 z.append(z0) -
sasmodels/sasview_model.py
re7fe459 r50ec515 38 38 39 39 # TODO: separate x_axis_label from multiplicity info 40 # The profile x-axis label belongs with the profile generating function41 40 MultiplicityInfo = collections.namedtuple( 42 41 'MultiplicityInfo', … … 141 140 p.name, p.choices, xlabel 142 141 ) 142 break 143 144 # Only a single drop-down list parameter available 145 fun_list = [] 146 for p in model_info.parameters.kernel_parameters: 147 if p.choices: 148 fun_list = p.choices 149 if p.length > 1: 150 non_fittable.extend(p.id+str(k) for k in range(1, p.length+1)) 143 151 break 144 152 … … 173 181 attrs['fixed'] = tuple(fixed) 174 182 attrs['non_fittable'] = tuple(non_fittable) 183 attrs['fun_list'] = tuple(fun_list) 175 184 176 185 return attrs
Note: See TracChangeset
for help on using the changeset viewer.