Changes in sasmodels/modelinfo.py [7b9e4dd:5399809] in sasmodels
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/modelinfo.py
r7b9e4dd r5399809 45 45 # Note that scale and background cannot be coordinated parameters whose value 46 46 # depends on the some polydisperse parameter with the current implementation 47 DEFAULT_BACKGROUND = 1e-348 47 COMMON_PARAMETERS = [ 49 48 ("scale", "", 1, (0.0, np.inf), "", "Source intensity"), 50 ("background", "1/cm", DEFAULT_BACKGROUND, (-np.inf, np.inf), "", "Source background"),49 ("background", "1/cm", 1e-3, (-np.inf, np.inf), "", "Source background"), 51 50 ] 52 51 assert (len(COMMON_PARAMETERS) == 2 … … 164 163 parameter.length = length 165 164 parameter.length_control = control 166 167 165 return parameter 168 166 … … 424 422 self.kernel_parameters = parameters 425 423 self._set_vector_lengths() 426 427 424 self.npars = sum(p.length for p in self.kernel_parameters) 428 425 self.nmagnetic = sum(p.length for p in self.kernel_parameters … … 431 428 if self.nmagnetic: 432 429 self.nvalues += 3 + 3*self.nmagnetic 433 434 430 self.call_parameters = self._get_call_parameters() 435 431 self.defaults = self._get_defaults() … … 467 463 self.magnetism_index = [k for k, p in enumerate(self.call_parameters) 468 464 if p.id.startswith('M0:')] 469 470 465 self.pd_1d = set(p.name for p in self.call_parameters 471 466 if p.polydisperse and p.type not in ('orientation', 'magnetic')) … … 771 766 # Custom sum/multi models 772 767 return kernel_module.model_info 768 773 769 info = ModelInfo() 774 770 #print("make parameter table", kernel_module.parameters) … … 792 788 info.category = getattr(kernel_module, 'category', None) 793 789 info.structure_factor = getattr(kernel_module, 'structure_factor', False) 790 # TODO: find Fq by inspection 791 info.effective_radius_type = getattr(kernel_module, 'effective_radius_type', None) 792 info.have_Fq = getattr(kernel_module, 'have_Fq', False) 794 793 info.profile_axes = getattr(kernel_module, 'profile_axes', ['x', 'y']) 795 794 info.source = getattr(kernel_module, 'source', []) 796 795 info.c_code = getattr(kernel_module, 'c_code', None) 796 info.effective_radius = getattr(kernel_module, 'effective_radius', None) 797 info.ER = None # CRUFT 798 info.VR = None # CRUFT 797 799 # TODO: check the structure of the tests 798 800 info.tests = getattr(kernel_module, 'tests', []) 799 info.ER = getattr(kernel_module, 'ER', None) # type: ignore800 info.VR = getattr(kernel_module, 'VR', None) # type: ignore801 801 info.form_volume = getattr(kernel_module, 'form_volume', None) # type: ignore 802 802 info.Iq = getattr(kernel_module, 'Iq', None) # type: ignore … … 823 823 info.lineno = {} 824 824 _find_source_lines(info, kernel_module) 825 826 825 return info 827 826 … … 916 915 #: provided in the file. 917 916 structure_factor = None # type: bool 917 #: True if the model defines an Fq function with signature 918 #: void Fq(double q, double *F1, double *F2, ...) 919 have_Fq = False 918 920 #: List of C source files used to define the model. The source files 919 921 #: should define the *Iq* function, and possibly *Iqac* or *Iqabc* if the … … 922 924 #: use those functions. Form factors are indicated by providing 923 925 #: an :attr:`ER` function. 926 effective_radius_type = None # type: List[str] 927 #: Returns the occupied volume and the total volume for each parameter set. 928 #: See :attr:`ER` for details on the parameters. 924 929 source = None # type: List[str] 925 930 #: The set of tests that must pass. The format of the tests is described … … 942 947 #: each parameter set. Multiplicity parameters will be received as 943 948 #: arrays, with one row per polydispersity condition. 944 ER = None # type: Optional[Callable[[np.ndarray], np.ndarray]]945 #: Returns the occupied volume and the total volume for each parameter set.946 #: See :attr:`ER` for details on the parameters.947 VR = None # type: Optional[Callable[[np.ndarray], Tuple[np.ndarray, np.ndarray]]]948 #: Arbitrary C code containing supporting functions, etc., to be inserted949 #: after everything in source. This can include Iq and Iqxy functions with950 #: the full function signature, including all parameters.951 949 c_code = None 952 950 #: Returns the form volume for python-based models. Form volume is needed
Note: See TracChangeset
for help on using the changeset viewer.