Changeset f3bd37f in sasmodels for sasmodels/compare_many.py
- Timestamp:
- Jul 17, 2016 2:36:34 PM (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:
- 46ed760
- Parents:
- b9c12fe5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/compare_many.py
r7ae2b7f rf3bd37f 20 20 21 21 from . import core 22 from .compare import ( MODELS,randomize_pars, suppress_pd, make_data,22 from .compare import (randomize_pars, suppress_pd, make_data, 23 23 make_engine, get_pars, columnize, 24 24 constrain_pars, constrain_new_to_old) 25 26 MODELS = core.list_models() 25 27 26 28 def calc_stats(target, value, index): … … 108 110 109 111 if is_2d: 110 if not model_info ['parameters'].has_2d:112 if not model_info.parameters.has_2d: 111 113 print(',"1-D only"') 112 114 return … … 145 147 146 148 147 calc_base = make_engine(model_info, data, base, cutoff) 148 calc_comp = make_engine(model_info, data, comp, cutoff) 149 try: 150 calc_base = make_engine(model_info, data, base, cutoff) 151 calc_comp = make_engine(model_info, data, comp, cutoff) 152 except Exception as exc: 153 #raise 154 print('"Error: %s"'%str(exc).replace('"',"'")) 155 print('"good","%d of %d","max diff",%g'%(0, N, np.NaN)) 156 return 149 157 expected = max(PRECISION[base], PRECISION[comp]) 150 158 … … 155 163 print("%s %d"%(name, k), file=sys.stderr) 156 164 seed = np.random.randint(1e6) 157 pars_i = randomize_pars( pars, seed)165 pars_i = randomize_pars(model_info, pars, seed) 158 166 constrain_pars(model_info, pars_i) 159 167 constrain_new_to_old(model_info, pars_i) … … 172 180 else: 173 181 print(("%d,"%seed)+','.join("%s"%v for v in columns)) 174 print('"good","%d /%d","max diff",%g'%(num_good, N, max_diff[0]))182 print('"good","%d of %d","max diff",%g'%(num_good, N, max_diff[0])) 175 183 176 184 … … 249 257 250 258 data, index = make_data({'qmax':1.0, 'is2d':is2D, 'nq':Nq, 'res':0., 251 'accuracy': 'Low', 'view':'log' })259 'accuracy': 'Low', 'view':'log', 'zero': False}) 252 260 model_list = [model] if model != "all" else MODELS 253 261 for model in model_list:
Note: See TracChangeset
for help on using the changeset viewer.