Changeset 256dfe1 in sasmodels for sasmodels/modelinfo.py
- Timestamp:
- Jul 18, 2016 12:42:29 AM (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:
- c5ac2b2
- Parents:
- 46ed760
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/modelinfo.py
r98ba1fc r256dfe1 186 186 vectors = dict((name,value) for name,value in pars.items() 187 187 if name in lookup and lookup[name].length > 1) 188 #print("lookup", lookup) 189 #print("scalars", scalars) 190 #print("vectors", vectors) 188 191 if vectors: 189 192 for name, value in vectors.items(): … … 194 197 key = name+str(k) 195 198 if key not in scalars: 196 scalars[key] = v ectors199 scalars[key] = value 197 200 else: 198 201 # supoprt for the form 199 202 # dict(thickness=[20,10,3]) 200 203 for (k,v) in enumerate(value): 201 scalars[name+str(k )] = v204 scalars[name+str(k+1)] = v 202 205 result.update(scalars) 206 #print("expanded", result) 203 207 204 208 return result … … 402 406 parameters don't use vector notation, and instead use p1, p2, ... 403 407 404 * *control_parameters* is the405 406 408 """ 407 409 # scale and background are implicit parameters … … 455 457 if p.polydisperse and p.type != 'magnetic') 456 458 457 458 459 def _set_vector_lengths(self): 459 # type: () -> None460 # type: () -> List[str] 460 461 """ 461 462 Walk the list of kernel parameters, setting the length field of the … … 466 467 initially created. 467 468 469 Returns the list of control parameter names. 470 468 471 Note: This modifies the underlying parameter object. 469 472 """ 470 473 # Sort out the length of the vector parameters such as thickness[n] 474 471 475 for p in self.kernel_parameters: 472 476 if p.length_control: … … 478 482 % (p.length_control, p.name)) 479 483 ref.is_control = True 484 ref.polydisperse = False 480 485 low, high = ref.limits 481 486 if int(low) != low or int(high) != high or low < 0 or high > 20: … … 689 694 info.profile = getattr(kernel_module, 'profile', None) # type: ignore 690 695 info.sesans = getattr(kernel_module, 'sesans', None) # type: ignore 691 info.control = getattr(kernel_module, 'control', None) 696 697 # multiplicity info 698 control_pars = [p.id for p in parameters.kernel_parameters if p.is_control] 699 default_control = control_pars[0] if control_pars else None 700 info.control = getattr(kernel_module, 'control', default_control) 692 701 info.hidden = getattr(kernel_module, 'hidden', None) # type: ignore 693 702
Note: See TracChangeset
for help on using the changeset viewer.