Changeset a4a7308 in sasmodels
- Timestamp:
- Mar 1, 2016 7:45:53 PM (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:
- 50e1e40
- Parents:
- ce0b154
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/compare.py
rce0b154 ra4a7308 305 305 Format the parameter list for printing. 306 306 """ 307 return "\n".join("%s: %s"%(p, v) for p, v in sorted(pars.items())) 307 active = None 308 fields = {} 309 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)) 324 return "\n".join(lines) 325 326 #return "\n".join("%s: %s"%(p, v) for p, v in sorted(pars.items())) 327 328 def _format_par(name, value=0., pd=0., n=0, nsigma=3., type='gaussian'): 329 line = "%s: %g"%(name, value) 330 if pd != 0. and n != 0: 331 line += " +/- %g (%d points in [-%g,%g] sigma %s)"\ 332 % (pd, n, nsigma, nsigma, type) 333 return line 308 334 309 335 def suppress_pd(pars): … … 770 796 constrain_new_to_old(model_definition, pars) 771 797 if opts['show_pars']: 772 print( "pars " +str(parlist(pars)))798 print(str(parlist(pars))) 773 799 774 800 # Create the computational engines
Note: See TracChangeset
for help on using the changeset viewer.