Changeset b6dab59 in sasmodels
- Timestamp:
- Sep 11, 2018 12:40:07 PM (6 years ago)
- Branches:
- master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
- Children:
- 1e420e6
- Parents:
- 2c12061
- Location:
- sasmodels
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/compare.py
rbd7630d rb6dab59 1151 1151 'rel_err' : True, 1152 1152 'explore' : False, 1153 'use_demo' : True,1153 'use_demo' : False, 1154 1154 'zero' : False, 1155 1155 'html' : False, -
sasmodels/generate.py
r6e45516 rb6dab59 968 968 pars = model_info.parameters.kernel_parameters 969 969 else: 970 pars = model_info.parameters.COMMON + model_info.parameters.kernel_parameters 970 pars = (model_info.parameters.common_parameters 971 + model_info.parameters.kernel_parameters) 971 972 partable = make_partable(pars) 972 973 subst = dict(id=model_info.id.replace('_', '-'), -
sasmodels/modelinfo.py
r7b9e4dd rb6dab59 405 405 parameters counted as n individual parameters p1, p2, ... 406 406 407 * *common_parameters* is the list of common parameters, with a unique 408 copy for each model so that structure factors can have a default 409 background of 0.0. 410 407 411 * *call_parameters* is the complete list of parameters to the kernel, 408 412 including scale and background, with vector parameters recorded as … … 417 421 parameters don't use vector notation, and instead use p1, p2, ... 418 422 """ 419 # scale and background are implicit parameters420 COMMON = [Parameter(*p) for p in COMMON_PARAMETERS]421 422 423 def __init__(self, parameters): 423 424 # type: (List[Parameter]) -> None 425 426 # scale and background are implicit parameters 427 # Need them to be unique to each model in case they have different 428 # properties, such as default=0.0 for structure factor backgrounds. 429 self.common_parameters = [Parameter(*p) for p in COMMON_PARAMETERS] 430 424 431 self.kernel_parameters = parameters 425 432 self._set_vector_lengths() … … 570 577 def _get_call_parameters(self): 571 578 # type: () -> List[Parameter] 572 full_list = self. COMMON[:]579 full_list = self.common_parameters[:] 573 580 for p in self.kernel_parameters: 574 581 if p.length == 1: … … 673 680 674 681 # Gather the user parameters in order 675 result = control + self. COMMON682 result = control + self.common_parameters 676 683 for p in self.kernel_parameters: 677 684 if not is2d and p.type in ('orientation', 'magnetic'): … … 772 779 return kernel_module.model_info 773 780 info = ModelInfo() 781 782 # Build the parameter table 774 783 #print("make parameter table", kernel_module.parameters) 775 784 parameters = make_parameter_table(getattr(kernel_module, 'parameters', [])) 785 786 # background defaults to zero for structure factor models 787 structure_factor = getattr(kernel_module, 'structure_factor', False) 788 if structure_factor: 789 # Make sure background is the second common parameter 790 assert COMMON_PARAMETERS[1][0] == "background" 791 parameters.common_parameters[1].default = 0.0 792 793 # TODO: remove demo parameters 794 # The plots in the docs are generated from the model default values. 795 # Sascomp set parameters from the command line, and so doesn't need 796 # demo values for testing. 776 797 demo = expand_pars(parameters, getattr(kernel_module, 'demo', None)) 798 777 799 filename = abspath(kernel_module.__file__).replace('.pyc', '.py') 778 800 kernel_id = splitext(basename(filename))[0] … … 791 813 info.docs = kernel_module.__doc__ 792 814 info.category = getattr(kernel_module, 'category', None) 793 info.structure_factor = getattr(kernel_module, 'structure_factor', False)815 info.structure_factor = structure_factor 794 816 info.profile_axes = getattr(kernel_module, 'profile_axes', ['x', 'y']) 795 817 info.source = getattr(kernel_module, 'source', []) -
sasmodels/models/hardsphere.py
r2d81cfe rb6dab59 171 171 # VR defaults to 1.0 172 172 173 demo = dict(radius_effective=200, volfraction=0.2,174 radius_effective_pd=0.1, radius_effective_pd_n=40)175 173 # Q=0.001 is in the Taylor series, low Q part, so add Q=0.1, 176 174 # assuming double precision sasview is correct
Note: See TracChangeset
for help on using the changeset viewer.