Changes in / [22e922e:0edb6c1] in sasmodels
- Location:
- sasmodels
- Files:
-
- 4 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
r31ae428 r765eb0e 32 32 # Build new parameter list 33 33 combined_pars = [] 34 demo = {}35 34 36 35 model_num = 0 … … 116 115 p.length_control = prefix + p.length_control 117 116 combined_pars.append(p) 118 demo.update((prefix+k, v) for k, v in part.demo.items()119 if k != "background")120 #print("pars",combined_pars)121 117 parameters = ParameterTable(combined_pars) 122 118 parameters.max_pd = sum(part.parameters.max_pd for part in parts) 119 120 def random(): 121 combined_pars = {} 122 for k, part in enumerate(parts): 123 prefix = chr(ord('A')+k) + '_' 124 pars = part.random() 125 combined_pars.update((prefix+k, v) for k, v in pars.items()) 126 return combined_pars 123 127 124 128 model_info = ModelInfo() … … 132 136 model_info.category = "custom" 133 137 model_info.parameters = parameters 138 model_info.random = random 134 139 #model_info.single = any(part['single'] for part in parts) 135 140 model_info.structure_factor = False … … 140 145 # Remember the component info blocks so we can build the model 141 146 model_info.composition = ('mixture', parts) 142 model_info.demo = demo143 147 return model_info 144 148 … … 149 153 self.info = model_info 150 154 self.parts = parts 155 self.dtype = parts[0].dtype 151 156 152 157 def make_kernel(self, q_vectors): -
sasmodels/models/spherical_sld.py
r63a7fe8 r2ad5d30 18 18 Interface shapes are as follows:: 19 19 20 0: erf( |nu|*z)21 1: Rpow( z^|nu|)22 2: Lpow( z^|nu|)23 3: Rexp( -|nu|z)24 4: Lexp( -|nu|z)20 0: erf($\nu z$) 21 1: Rpow($z^\nu$) 22 2: Lpow($z^\nu$) 23 3: Rexp($-\nu z$) 24 4: Lexp($-\nu z$) 25 25 26 26 Definition -
sasmodels/product.py
r6a5ccfb 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.