Changeset 7ae2b7f in sasmodels for sasmodels/resolution.py


Ignore:
Timestamp:
Apr 11, 2016 12:48:41 PM (8 years ago)
Author:
Paul Kienzle <pkienzle@…>
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:
fa5fd8d
Parents:
f619de7
Message:

still more linting; ignore numpy types

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/resolution.py

    r6d6508e r7ae2b7f  
    66from __future__ import division 
    77 
    8 from scipy.special import erf 
    9 from numpy import sqrt, log, log10 
    10 import numpy as np 
     8from scipy.special import erf  # type: ignore 
     9from numpy import sqrt, log, log10, exp, pi  # type: ignore 
     10import numpy as np  # type: ignore 
    1111 
    1212__all__ = ["Resolution", "Perfect1D", "Pinhole1D", "Slit1D", 
     
    3535    smeared theory I(q). 
    3636    """ 
    37     q = None 
    38     q_calc = None 
     37    q = None  # type: np.ndarray 
     38    q_calc = None  # type: np.ndarray 
    3939    def apply(self, theory): 
    4040        """ 
     
    489489    *q0* is the center, *dq* is the width and *q* are the points to evaluate. 
    490490    """ 
    491     from numpy import exp, pi 
    492491    return exp(-0.5*((q-q0)/dq)**2)/(sqrt(2*pi)*dq) 
    493492 
     
    500499    that make it slow to evaluate but give it good accuracy. 
    501500    """ 
    502     from scipy.integrate import romberg 
     501    from scipy.integrate import romberg  # type: ignore 
    503502 
    504503    par_set = set([p.name for p in form.info.parameters.call_parameters]) 
     
    555554    that make it slow to evaluate but give it good accuracy. 
    556555    """ 
    557     from scipy.integrate import romberg 
     556    from scipy.integrate import romberg  # type: ignore 
    558557 
    559558    par_set = set([p.name for p in form.info.parameters.call_parameters]) 
     
    752751        #tol = 0.001 
    753752        ## The default 3 sigma and no extra points gets 1% 
    754         q_calc, tol = None, 0.01 
     753        q_calc = None  # type: np.ndarray 
     754        tol = 0.01 
    755755        resolution = Pinhole1D(q, q_width, q_calc=q_calc) 
    756756        output = self._eval_sphere(pars, resolution) 
    757757        if 0: # debug plot 
    758             import matplotlib.pyplot as plt 
     758            import matplotlib.pyplot as plt  # type: ignore 
    759759            resolution = Perfect1D(q) 
    760760            source = self._eval_sphere(pars, resolution) 
     
    10281028    """ 
    10291029    import sys 
    1030     import xmlrunner 
     1030    import xmlrunner  # type: ignore 
    10311031 
    10321032    suite = unittest.TestSuite() 
     
    10761076        Iq_romb = romberg_pinhole_1d(resolution.q, dq, model, pars) 
    10771077 
    1078     import matplotlib.pyplot as plt 
     1078    import matplotlib.pyplot as plt  # type: ignore 
    10791079    plt.loglog(resolution.q_calc, theory, label='unsmeared') 
    10801080    plt.loglog(resolution.q, Iq, label='smeared', hold=True) 
     
    11111111    Run the resolution demos. 
    11121112    """ 
    1113     import matplotlib.pyplot as plt 
     1113    import matplotlib.pyplot as plt  # type: ignore 
    11141114    plt.subplot(121) 
    11151115    demo_pinhole_1d() 
Note: See TracChangeset for help on using the changeset viewer.