Changeset 6e604f8 in sasmodels for explore/asymint.py


Ignore:
Timestamp:
Oct 24, 2017 8:05:08 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:
5110e16
Parents:
20fe0cd
Message:

fix broken explore/asymint.py (environment now set up with static methods rather than instance methods)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • explore/asymint.py

    r20fe0cd r6e604f8  
    2424 
    2525class MPenv: 
    26     sqrt = mp.sqrt 
    27     exp = mp.exp 
    28     expm1 = mp.expm1 
    29     cos = mp.cos 
    30     sin = mp.sin 
    31     tan = mp.tan 
     26    sqrt = staticmethod(mp.sqrt) 
     27    exp = staticmethod(mp.exp) 
     28    expm1 = staticmethod(mp.expm1) 
     29    cos = staticmethod(mp.cos) 
     30    sin = staticmethod(mp.sin) 
     31    tan = staticmethod(mp.tan) 
     32    @staticmethod 
    3233    def sas_3j1x_x(x): 
    3334        return 3*(mp.sin(x)/x - mp.cos(x))/(x*x) 
     35    @staticmethod 
    3436    def sas_2J1x_x(x): 
    3537        return 2*mp.j1(x)/x 
     38    @staticmethod 
    3639    def sas_sinx_x(x): 
    3740        return mp.sin(x)/x 
    3841    pi = mp.pi 
    39     mpf = mp.mpf 
     42    mpf = staticmethod(mp.mpf) 
    4043 
    4144class NPenv: 
    42     sqrt = np.sqrt 
    43     exp = np.exp 
    44     expm1 = np.expm1 
    45     cos = np.cos 
    46     sin = np.sin 
    47     tan = np.tan 
    48     sas_3j1x_x = sp.sas_3j1x_x 
    49     sas_2J1x_x = sp.sas_2J1x_x 
    50     sas_sinx_x = sp.sas_sinx_x 
     45    sqrt = staticmethod(np.sqrt) 
     46    exp = staticmethod(np.exp) 
     47    expm1 = staticmethod(np.expm1) 
     48    cos = staticmethod(np.cos) 
     49    sin = staticmethod(np.sin) 
     50    tan = staticmethod(np.tan) 
     51    sas_3j1x_x = staticmethod(sp.sas_3j1x_x) 
     52    sas_2J1x_x = staticmethod(sp.sas_2J1x_x) 
     53    sas_sinx_x = staticmethod(sp.sas_sinx_x) 
    5154    pi = np.pi 
    52     mpf = float 
     55    mpf = staticmethod(float) 
    5356 
    5457SLD = 3 
Note: See TracChangeset for help on using the changeset viewer.