Changeset 248561a in sasmodels
- Timestamp:
- Oct 17, 2016 11:09:44 AM (8 years ago)
- Branches:
- master, core_shell_microgels, costrafo411, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 52e9a45
- Parents:
- 7fcdc9f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/compare.py
rff1fff5 r248561a 110 110 111 111 kerneldll.ALLOW_SINGLE_PRECISION_DLLS = True 112 113 # list of math functions for use in evaluating parameters 114 MATH = dict((k,getattr(math, k)) for k in dir(math) if not k.startswith('_')) 112 115 113 116 # CRUFT python 2.6 … … 923 926 pars = get_pars(model_info, opts['use_demo']) 924 927 pars2 = get_pars(model_info2, opts['use_demo']) 928 pars2.update((k, v) for k, v in pars.items() if k in pars2) 925 929 # randomize parameters 926 930 #pars.update(set_pars) # set value before random to control range … … 953 957 954 958 # Evaluate preset parameter expressions 955 context = pars.copy() 959 context = MATH.copy() 960 context.update(pars) 956 961 context.update((k,v) for k,v in presets.items() if isinstance(v, float)) 957 962 for k, v in presets.items(): 958 963 if not isinstance(v, float) and not k.endswith('_type'): 959 964 presets[k] = eval(v, context) 960 context = pars.copy()961 965 context.update(presets) 962 966 context.update((k,v) for k,v in presets2.items() if isinstance(v, float)) … … 995 999 996 1000 if opts['show_pars']: 997 print(str(parlist(model_info, pars, opts['is2d']))) 1001 if not same_model: 1002 print("==== %s ====="%model_info.name) 1003 print(str(parlist(model_info, pars, opts['is2d']))) 1004 print("==== %s ====="%model_info2.name) 1005 print(str(parlist(model_info2, pars2, opts['is2d']))) 1006 else: 1007 print(str(parlist(model_info, pars, opts['is2d']))) 998 1008 999 1009 # Create the computational engines
Note: See TracChangeset
for help on using the changeset viewer.