Changeset 5124c969 in sasmodels for sasmodels/compare_many.py
- Timestamp:
- Feb 27, 2017 3:55:59 PM (7 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:
- c713c85
- Parents:
- a3002be
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/compare_many.py
r424fe00 r5124c969 106 106 header = ('\n"Model","%s","Count","%d","Dimension","%s"' 107 107 % (name, N, "2D" if is_2d else "1D")) 108 if not mono: header += ',"Cutoff",%g'%(cutoff,) 108 if not mono: 109 header += ',"Cutoff",%g'%(cutoff,) 109 110 print(header) 110 111 … … 161 162 max_diff = [0] 162 163 for k in range(N): 163 print(" %s %d"%(name, k), file=sys.stderr)164 print("Model %s %d"%(name, k+1), file=sys.stderr) 164 165 seed = np.random.randint(1e6) 165 166 pars_i = randomize_pars(model_info, pars, seed) 166 167 constrain_pars(model_info, pars_i) 167 constrain_new_to_old(model_info, pars_i) 168 if 'sasview' in (base, comp): 169 constrain_new_to_old(model_info, pars_i) 168 170 if mono: 169 171 pars_i = suppress_pd(pars_i) … … 204 206 print("""\ 205 207 206 MODEL is the model name of the model or "all" for all the models 207 in alphabetical order. 208 MODEL is the model name of the model or one of the model types listed in 209 sasmodels.core.list_models (all, py, c, double, single, opencl, 1d, 2d, 210 nonmagnetic, magnetic). Model types can be combined, such as 2d+single. 208 211 209 212 COUNT is the number of randomly generated parameter sets to try. A value … … 237 240 return 238 241 239 model = argv[0] 240 if not (model in MODELS) and (model != "all"): 241 print('Bad model %s. Use "all" or one of:'%model) 242 target = argv[0] 243 try: 244 model_list = [target] if target in MODELS else core.list_models(target) 245 except ValueError: 246 print('Bad model %s. Use model type or one of:'%model) 242 247 print_models() 248 print('model types: all, py, c, double, single, opencl, 1d, 2d, nonmagnetic, magnetic') 243 249 return 244 250 try: … … 258 264 data, index = make_data({'qmax':1.0, 'is2d':is2D, 'nq':Nq, 'res':0., 259 265 'accuracy': 'Low', 'view':'log', 'zero': False}) 260 model_list = [model] if model != "all" else MODELS261 266 for model in model_list: 262 267 compare_instance(model, data, index, N=count, mono=mono,
Note: See TracChangeset
for help on using the changeset viewer.