Changeset bde38b5 in sasmodels for sasmodels/kernelpy.py
- Timestamp:
- Aug 14, 2016 9:12:40 PM (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:
- ac98886
- Parents:
- b1c40bee
- git-author:
- Paul Kienzle <pkienzle@…> (08/14/16 21:08:59)
- git-committer:
- Paul Kienzle <pkienzle@…> (08/14/16 21:12:40)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/kernelpy.py
r40a87fa rbde38b5 100 100 """ 101 101 def __init__(self, kernel, model_info, q_input): 102 # type: (callable, ModelInfo, List[np.ndarray]) -> None 102 103 self.dtype = np.dtype('d') 103 104 self.info = model_info … … 156 157 157 158 def __call__(self, call_details, values, cutoff, magnetic): 158 assert isinstance(call_details, details.CallDetails) 159 # type: (CallDetails, np.ndarray, np.ndarray, float, bool) -> np.ndarray 160 if magnetic: 161 raise NotImplementedError("Magnetism not implemented for pure python models") 162 #print("Calling python kernel") 163 #call_details.show(values) 159 164 res = _loops(self._parameter_vector, self._form, self._volume, 160 165 self.q_input.nq, call_details, values, cutoff) … … 162 167 163 168 def release(self): 169 # type: () -> None 164 170 """ 165 171 Free resources associated with the kernel. … … 189 195 return np.ones(nq, 'd')*background 190 196 191 pd_value = values[2+n_pars:2+n_pars + call_details. pd_sum]192 pd_weight = values[2+n_pars + call_details. pd_sum:]197 pd_value = values[2+n_pars:2+n_pars + call_details.num_weights] 198 pd_weight = values[2+n_pars + call_details.num_weights:] 193 199 194 200 pd_norm = 0.0 … … 209 215 210 216 total = np.zeros(nq, 'd') 211 for loop_index in range(call_details. pd_prod):217 for loop_index in range(call_details.num_eval): 212 218 # update polydispersity parameter values 213 219 if p0_index == p0_length:
Note: See TracChangeset
for help on using the changeset viewer.