Changeset a7f909a in sasmodels
- Timestamp:
- Jan 7, 2016 1:47:25 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:
- 82c299f, 55a8316
- Parents:
- 3f832f9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/compare_many.py
rec7e360 ra7f909a 1 1 #!/usr/bin/env python 2 from __future__ import print_function 3 2 4 import sys 3 5 import traceback … … 6 8 7 9 from . import core 8 from .kernelcl import environment 9 from .compare import (MODELS, randomize_pars, suppress_pd, eval_sasview, 10 eval_opencl, eval_ctypes, make_data, get_demo_pars, 11 columnize, constrain_pars, constrain_new_to_old, 12 make_engine) 10 from . import generate 11 from .compare import (MODELS, randomize_pars, suppress_pd, make_data, 12 make_engine, get_demo_pars, columnize, 13 constrain_pars, constrain_new_to_old) 13 14 14 15 def calc_stats(target, value, index): … … 47 48 def compare_instance(name, data, index, N=1, mono=True, cutoff=1e-5, 48 49 base='sasview', comp='double'): 50 is2D = hasattr(data, 'qx_data') 49 51 model_definition = core.load_model_definition(name) 50 52 pars = get_demo_pars(model_definition) 51 header = '\n"Model","%s","Count","%d"'%(name, N) 53 header = ('\n"Model","%s","Count","%d","Dimension","%s"' 54 % (name, N, "2D" if is2D else "1D")) 52 55 if not mono: header += ',"Cutoff",%g'%(cutoff,) 53 56 print(header) 57 58 if is2D: 59 info = generate.make_info(model_definition) 60 partype = info['partype'] 61 if not partype['orientation'] and not partype['magnetic']: 62 print(',"1-D only"') 63 return 54 64 55 65 # Some not very clean macros for evaluating the models and checking the … … 88 98 max_diff = [0] 89 99 for k in range(N): 90 print("%s %d"%(name, k) )100 print("%s %d"%(name, k), file=sys.stderr) 91 101 seed = np.random.randint(1e6) 92 102 pars_i = randomize_pars(pars, seed)
Note: See TracChangeset
for help on using the changeset viewer.