Changeset 04dc697 in sasmodels for sasmodels/sasview_model.py
- Timestamp:
- Apr 13, 2016 11:39:09 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:
- 60f03de
- Parents:
- a18c5b3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/sasview_model.py
ra18c5b3 r04dc697 31 31 32 32 try: 33 from typing import Dict, Mapping, Any, Sequence, Tuple, NamedTuple, List, Optional 33 from typing import Dict, Mapping, Any, Sequence, Tuple, NamedTuple, List, Optional, Union 34 34 from .modelinfo import ModelInfo, Parameter 35 35 from .kernel import KernelModel … … 42 42 43 43 # TODO: separate x_axis_label from multiplicity info 44 # The x-axis label belongs with the profile generating function44 # The profile x-axis label belongs with the profile generating function 45 45 MultiplicityInfo = collections.namedtuple( 46 46 'MultiplicityInfo', … … 220 220 dispersion = None # type: Dict[str, Any] 221 221 #: units and limits for each parameter 222 details = None # type: Mapping[str, Tuple (str, float, float)]223 #: multiplicity used, or None if no multiplicity controls222 details = None # type: Mapping[str, Tuple[str, float, float]] 223 #: multiplicity value, or None if no multiplicity on the model 224 224 multiplicity = None # type: Optional[int] 225 #: memory for polydispersity array if using ArrayDispersion (used by sasview). 226 _persistency_dict = None # type: Dict[str, Tuple[np.ndarray, np.ndarray]] 225 227 226 228 def __init__(self, multiplicity=None): 227 # type: () -> None 228 229 ## _persistency_dict is used by sas.perspectives.fitting.basepage 230 ## to store dispersity reference. 231 self._persistency_dict = {} 229 # type: (Optional[int]) -> None 232 230 233 231 # TODO: _persistency_dict to persistency_dict throughout sasview … … 252 250 hidden = set() 253 251 252 self._persistency_dict = {} 254 253 self.params = collections.OrderedDict() 255 254 self.dispersion = {} … … 375 374 376 375 def getParamList(self): 377 # type: () - 376 # type: () -> Sequence[str] 378 377 """ 379 378 Return a list of all available parameters for the model 380 379 """ 381 param_list = self.params.keys()380 param_list = list(self.params.keys()) 382 381 # WARNING: Extending the list with the dispersion parameters 383 382 param_list.extend(self.getDispParamList()) … … 385 384 386 385 def getDispParamList(self): 387 # type: () - 386 # type: () -> Sequence[str] 388 387 """ 389 388 Return a list of polydispersity parameters for the model … … 398 397 399 398 def clone(self): 400 # type: () - 399 # type: () -> "SasviewModel" 401 400 """ Return a identical copy of self """ 402 401 return deepcopy(self) … … 439 438 440 439 def evalDistribution(self, qdist): 441 # type: (Union[np.ndarray, Tuple[np.ndarray, np.ndarray], List[np.ndarray] ) -> np.ndarray440 # type: (Union[np.ndarray, Tuple[np.ndarray, np.ndarray], List[np.ndarray]]) -> np.ndarray 442 441 r""" 443 442 Evaluate a distribution of q-values.
Note: See TracChangeset
for help on using the changeset viewer.