Changeset 9bc4882 in sasmodels for sasmodels/kernelpy.py


Ignore:
Timestamp:
Sep 5, 2017 11:01:03 AM (7 years ago)
Author:
Paul Kienzle <pkienzle@…>
Branches:
master, core_shell_microgels, magnetic_model, ticket-1257-vesicle-product, ticket_1156, ticket_1265_superball, ticket_822_more_unit_tests
Children:
8db25bf
Parents:
acc6c8f (diff), 142a8e2 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into ticket-776-orientation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/kernelpy.py

    rd4c33d6 r9bc4882  
    99from __future__ import division, print_function 
    1010 
     11import logging 
     12 
    1113import numpy as np  # type: ignore 
    1214from numpy import pi, sin, cos  #type: ignore 
     
    1820try: 
    1921    from typing import Union, Callable 
    20 except: 
     22except ImportError: 
    2123    pass 
    2224else: 
     
    3133        _create_default_functions(model_info) 
    3234        self.info = model_info 
     35        self.dtype = np.dtype('d') 
    3336 
    3437    def make_kernel(self, q_vectors): 
     38        logging.info("creating python kernel " + self.info.name) 
    3539        q_input = PyInput(q_vectors, dtype=F64) 
    3640        kernel = self.info.Iqxy if q_input.is_2d else self.info.Iq 
     
    228232            # INVALID expression like the C models, but that is too expensive. 
    229233            Iq = np.asarray(form(), 'd') 
    230             if np.isnan(Iq).any(): continue 
     234            if np.isnan(Iq).any(): 
     235                continue 
    231236 
    232237            # update value and norm 
     
    291296        default_Iqxy.vectorized = True 
    292297        model_info.Iqxy = default_Iqxy 
    293  
Note: See TracChangeset for help on using the changeset viewer.