Changeset 32e3c9b in sasmodels for sasmodels/kerneldll.py
- Timestamp:
- Jul 21, 2016 4:08:04 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:
- b966a96
- Parents:
- 42356c8
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sasmodels/kerneldll.py
rdef2c1b r32e3c9b 270 270 # int, int, int, int*, double*, double*, double*, double*, double 271 271 argtypes = [c_int32]*3 + [c_void_p]*4 + [fp] 272 self._Iq = self._dll[generate.kernel_name(self.info, is_2d=False)] 273 self._Iqxy = self._dll[generate.kernel_name(self.info, is_2d=True)] 272 self._Iq = self._dll[generate.kernel_name(self.info, "Iq")] 273 self._Iqxy = self._dll[generate.kernel_name(self.info, "Iqxy")] 274 self._Imagnetic = self._dll[generate.kernel_name(self.info, "Imagnetic")] 274 275 self._Iq.argtypes = argtypes 275 276 self._Iqxy.argtypes = argtypes 277 self._Imagnetic.argtypes = argtypes 276 278 277 279 def __getstate__(self): … … 284 286 self._dll = None 285 287 286 def make_kernel(self, q_vectors ):288 def make_kernel(self, q_vectors, magnetic=False): 287 289 # type: (List[np.ndarray]) -> DllKernel 288 290 q_input = PyInput(q_vectors, self.dtype) … … 290 292 if self._dll is None: 291 293 self._load_dll() 292 kernel = self._Iqxyif q_input.is_2d else self._Iq294 kernel = [self._Iqxy, self._Imagnetic] if q_input.is_2d else self._Iq 293 295 return DllKernel(kernel, self.info, q_input) 294 296 … … 341 343 else np.float128) 342 344 343 def __call__(self, call_details, values, cutoff ):344 # type: (CallDetails, np.ndarray, np.ndarray, float ) -> np.ndarray345 def __call__(self, call_details, values, cutoff, magnetic): 346 # type: (CallDetails, np.ndarray, np.ndarray, float, bool) -> np.ndarray 345 347 346 348 #print("in kerneldll") … … 358 360 ] 359 361 #print("calling DLL") 360 self.kernel (*args) # type: ignore362 self.kernel[1 if magnetic else 0](*args) # type: ignore 361 363 return self.result[:-1] 362 364
Note: See TracChangeset
for help on using the changeset viewer.