Changeset a21d889 in sasmodels
- Timestamp:
- Apr 5, 2018 12:36:38 PM (7 years ago)
- Branches:
- master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 34f2857
- Parents:
- 05df1de
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/compare.py
rd86f0fc ra21d889 1329 1329 1330 1330 # Evaluate preset parameter expressions 1331 # Note: need to replace ':' with '_' in parameter names and expressions 1332 # in order to support math on magnetic parameters. 1331 1333 context = MATH.copy() 1332 1334 context['np'] = np 1333 context.update( pars)1335 context.update((k.replace(':', '_'), v) for k, v in pars.items()) 1334 1336 context.update((k, v) for k, v in presets.items() if isinstance(v, float)) 1337 #for k,v in sorted(context.items()): print(k, v) 1335 1338 for k, v in presets.items(): 1336 1339 if not isinstance(v, float) and not k.endswith('_type'): 1337 presets[k] = eval(v , context)1340 presets[k] = eval(v.replace(':', '_'), context) 1338 1341 context.update(presets) 1339 context.update((k , v) for k, v in presets2.items() if isinstance(v, float))1342 context.update((k.replace(':', '_'), v) for k, v in presets2.items() if isinstance(v, float)) 1340 1343 for k, v in presets2.items(): 1341 1344 if not isinstance(v, float) and not k.endswith('_type'): 1342 presets2[k] = eval(v , context)1345 presets2[k] = eval(v.replace(':', '_'), context) 1343 1346 1344 1347 # update parameters with presets
Note: See TracChangeset
for help on using the changeset viewer.