Changeset 765eb0e in sasmodels
- Timestamp:
- Sep 11, 2017 5:42:31 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:
- 2ad5d30
- Parents:
- ce8c388
- Location:
- sasmodels
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/compare.py
rd9ec8f9 r765eb0e 88 88 -magnetic/-nonmagnetic* suppress magnetism 89 89 -accuracy=Low accuracy of the resolution calculation Low, Mid, High, Xhigh 90 -neval=1 sets the number of evals for more accurate timing 90 91 91 92 === precision options === … … 1013 1014 'magnetic', 'nonmagnetic', 1014 1015 'accuracy=', 1016 'neval=', # for timing... 1015 1017 1016 1018 # Precision options … … 1018 1020 'half', 'fast', 'single', 'double', 'single!', 'double!', 'quad!', 1019 1021 'sasview', # TODO: remove sasview 3.x support 1020 'timing=',1021 1022 1022 1023 # Output options … … 1068 1069 1069 1070 # Plug in values given in demo 1070 if use_demo :1071 if use_demo and model_info.demo: 1071 1072 pars.update(model_info.demo) 1072 1073 return pars -
sasmodels/mixture.py
r6dc78e4 r765eb0e 40 40 # Build new parameter list 41 41 combined_pars = [] 42 demo = {}43 42 for k, part in enumerate(parts): 44 43 # Parameter prefix per model, A_, B_, ... … … 56 55 p.length_control = prefix + p.length_control 57 56 combined_pars.append(p) 58 demo.update((prefix+k, v) for k, v in part.demo.items()59 if k != "background")60 #print("pars",combined_pars)61 57 parameters = ParameterTable(combined_pars) 62 58 parameters.max_pd = sum(part.parameters.max_pd for part in parts) 59 60 def random(): 61 combined_pars = {} 62 for k, part in enumerate(parts): 63 prefix = chr(ord('A')+k) + '_' 64 pars = part.random() 65 combined_pars.update((prefix+k, v) for k, v in pars.items()) 66 return combined_pars 63 67 64 68 model_info = ModelInfo() … … 71 75 model_info.category = "custom" 72 76 model_info.parameters = parameters 77 model_info.random = random 73 78 #model_info.single = any(part['single'] for part in parts) 74 79 model_info.structure_factor = False … … 79 84 # Remember the component info blocks so we can build the model 80 85 model_info.composition = ('mixture', parts) 81 model_info.demo = demo82 86 return model_info 83 87 … … 88 92 self.info = model_info 89 93 self.parts = parts 94 self.dtype = parts[0].dtype 90 95 91 96 def make_kernel(self, q_vectors): -
sasmodels/product.py
r8f04da4 r765eb0e 68 68 translate_name = dict((old.id, new.id) for old, new 69 69 in zip(s_pars.kernel_parameters[1:], s_list)) 70 demo = {}71 demo.update(p_info.demo.items())72 demo.update((translate_name[k], v) for k, v in s_info.demo.items()73 if k not in ("background", "scale") and not k.startswith(ER_ID))74 70 combined_pars = p_pars.kernel_parameters + s_list 75 71 parameters = ParameterTable(combined_pars) 76 72 parameters.max_pd = p_pars.max_pd + s_pars.max_pd 73 def random(): 74 combined_pars = p_info.random() 75 s_names = set(par.id for par in s_pars.kernel_parameters[1:]) 76 s = s_info.random() 77 combined_pars.update((translate_name[k], v) 78 for k, v in s_info.random().items() 79 if k in s_names) 80 return combined_pars 77 81 78 82 model_info = ModelInfo() … … 85 89 model_info.category = "custom" 86 90 model_info.parameters = parameters 91 model_info.random = random 87 92 #model_info.single = p_info.single and s_info.single 88 93 model_info.structure_factor = False … … 95 100 # TODO: delegate random to p_info, s_info 96 101 #model_info.random = lambda: {} 97 model_info.demo = demo 98 99 ## Show the parameter table with the demo values 102 103 ## Show the parameter table 100 104 #from .compare import get_pars, parlist 101 105 #print("==== %s ====="%model_info.name) 102 #values = get_pars(model_info , use_demo=True)106 #values = get_pars(model_info) 103 107 #print(parlist(model_info, values, is2d=True)) 104 108 return model_info … … 126 130 self.P = P 127 131 self.S = S 132 self.dtype = P.dtype 128 133 129 134 def make_kernel(self, q_vectors):
Note: See TracChangeset
for help on using the changeset viewer.