Changeset d6850fa in sasmodels
- Timestamp:
- Mar 17, 2016 9:01:41 AM (9 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:
- 3a45c2c
- Parents:
- 246517d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/compare.py
rfcd7bbd rd6850fa 301 301 pars['Phi'+c] /= total 302 302 303 def parlist( pars):303 def parlist(model_info, pars, is2d): 304 304 """ 305 305 Format the parameter list for printing. 306 306 """ 307 active = None 308 fields = {} 307 if is2d: 308 exclude = lambda n: False 309 else: 310 partype = model_info['partype'] 311 par1d = set(partype['fixed-1d']+partype['pd-1d']) 312 exclude = lambda n: n not in par1d 309 313 lines = [] 310 for k, v in sorted(pars.items()): 311 parts = k.split('_pd') 312 #print(k, active, parts) 313 if len(parts) == 1: 314 if active: lines.append(_format_par(active, **fields)) 315 active = k 316 fields = {'value': v} 317 else: 318 assert parts[0] == active 319 if parts[1]: 320 fields[parts[1][1:]] = v 321 else: 322 fields['pd'] = v 323 if active: lines.append(_format_par(active, **fields)) 314 for p in model_info['parameters']: 315 if exclude(p.name): continue 316 fields = dict( 317 value=pars.get(p.name, p.default), 318 pd=pars.get(p.name+"_pd", 0.), 319 n=int(pars.get(p.name+"_pd_n", 0)), 320 nsigma=pars.get(p.name+"_pd_nsgima", 3.), 321 type=pars.get(p.name+"_pd_type", 'gaussian')) 322 lines.append(_format_par(p.name, **fields)) 324 323 return "\n".join(lines) 325 324 … … 837 836 constrain_new_to_old(model_info, pars) 838 837 if opts['show_pars']: 839 print(str(parlist( pars)))838 print(str(parlist(model_info, pars, opts['is2d']))) 840 839 841 840 # Create the computational engines
Note: See TracChangeset
for help on using the changeset viewer.