Changeset c1a888b in sasmodels
- Timestamp:
- Apr 8, 2016 7:38:35 PM (9 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:
- 9a943d0
- Parents:
- f6029fd
- Location:
- sasmodels
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/kernelpy.py
re62a134 rc1a888b 14 14 15 15 try: 16 from typing import Union 16 from typing import Union, Callable 17 17 except: 18 18 pass -
sasmodels/model_test.py
re62a134 rc1a888b 323 323 324 324 def model_tests(): 325 # type: () -> Iterator[Callable[[], None] 325 # type: () -> Iterator[Callable[[], None]] 326 326 """ 327 327 Test runner visible to nosetests. -
sasmodels/modelinfo.py
rf6029fd rc1a888b 83 83 # if limits is a list of strings, then this is a choice list 84 84 # field, and limits are 1 to length of string list 85 choices = [] # type: List[str] 85 86 if isinstance(limits, list) and all(isstr(k) for k in limits): 86 87 choices = limits 87 limits = [0, len(choices)-1] 88 else: 89 choices = [] 88 limits = (0., len(choices)-1.) 89 90 90 # TODO: maybe allow limits of None for (-inf, inf) 91 91 try: … … 276 276 def __init__(self, name, units='', default=None, limits=(-np.inf, np.inf), 277 277 ptype='', description=''): 278 # type: (str, str, float, Limits, str, str) 278 # type: (str, str, float, Limits, str, str) -> None 279 279 self.id = name.split('[')[0].strip() # type: str 280 280 self.name = name # type: str … … 327 327 328 328 def as_call_reference(self, prefix=""): 329 # type: ( ) -> str329 # type: (str) -> str 330 330 # Note: if the parameter is a struct type, then we will need to use 331 331 # &prefix+id. For scalars and vectors we can just use prefix+id. … … 549 549 550 550 # Gather entries such as name[n] into groups of the same n 551 dependent = dict((p.id, []) for p in control) 551 dependent = dict((p.id, []) for p in control) # type: Dict[str, List[Parameter]] 552 552 for p in self.kernel_parameters: 553 553 if p.length_control is not None: … … 555 555 556 556 # Gather entries such as name[4] into groups of the same length 557 fixed = {} 557 fixed = {} # type: Dict[int, List[Parameter]] 558 558 for p in self.kernel_parameters: 559 559 if p.length > 1 and p.length_control is None: … … 617 617 info = ModelInfo() 618 618 #print("make parameter table", kernel_module.parameters) 619 parameters = make_parameter_table( kernel_module.parameters)619 parameters = make_parameter_table(getattr(kernel_module, 'parameters', [])) 620 620 demo = expand_pars(parameters, getattr(kernel_module, 'demo', None)) 621 621 filename = abspath(kernel_module.__file__) … … 713 713 source = None # type: List[str] 714 714 tests = None # type: List[TestCondition] 715 ER = None # type: Optional[Callable[[np.ndarray , ...], np.ndarray]]716 VR = None # type: Optional[Callable[[np.ndarray , ...], Tuple[np.ndarray, np.ndarray]]]717 form_volume = None # type: Optional[Callable[[np.ndarray , ...], float]]718 Iq = None # type: Optional[Callable[[np.ndarray , ...], np.ndarray]]719 Iqxy = None # type: Optional[Callable[[np.ndarray , ...], np.ndarray]]720 profile = None 721 sesans = None 715 ER = None # type: Optional[Callable[[np.ndarray], np.ndarray]] 716 VR = None # type: Optional[Callable[[np.ndarray], Tuple[np.ndarray, np.ndarray]]] 717 form_volume = None # type: Optional[Callable[[np.ndarray], float]] 718 Iq = None # type: Optional[Callable[[np.ndarray], np.ndarray]] 719 Iqxy = None # type: Optional[Callable[[np.ndarray], np.ndarray]] 720 profile = None # type: Optional[Callable[[np.ndarray], None]] 721 sesans = None # type: Optional[Callable[[np.ndarray], np.ndarray]] 722 722 mono_details = None # type: CallDetails 723 723
Note: See TracChangeset
for help on using the changeset viewer.