Changeset 4e28511 in sasmodels


Ignore:
Timestamp:
Mar 20, 2019 9:00:26 PM (2 months 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:
df20715, 069743a
Parents:
b297ba9
Message:

more lint

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • extra/pylint.rc

    rb297ba9 r4e28511  
    290290# (useful for modules/projects where namespaces are manipulated during runtime 
    291291# and thus existing member attributes cannot be deduced by static analysis 
    292 ignored-modules=bumps,sas,numpy,numpy.random,scipy,scipy.special 
     292ignored-modules=bumps,sas,numpy,numpy.random,scipy,scipy.special,pyopencl,pycuda,matplotlib.cm,ipyvolume,ipywidget 
    293293 
    294294# List of classes names for which member attributes should not be checked 
  • sasmodels/jitter.py

    rb297ba9 r4e28511  
    114114def draw_sc(axes, size, view, jitter, steps=None, alpha=1): 
    115115    """Draw points for simple cubic paracrystal""" 
     116    # pylint: disable=unused-argument 
    116117    atoms = _build_sc() 
    117118    _draw_crystal(axes, size, view, jitter, atoms=atoms) 
     
    119120def draw_fcc(axes, size, view, jitter, steps=None, alpha=1): 
    120121    """Draw points for face-centered cubic paracrystal""" 
     122    # pylint: disable=unused-argument 
    121123    # Build the simple cubic crystal 
    122124    atoms = _build_sc() 
     
    134136def draw_bcc(axes, size, view, jitter, steps=None, alpha=1): 
    135137    """Draw points for body-centered cubic paracrystal""" 
     138    # pylint: disable=unused-argument 
    136139    # Build the simple cubic crystal 
    137140    atoms = _build_sc() 
     
    189192                        color=(0.6, 1.0, 0.6), alpha=1): 
    190193    """Draw a parallelepiped surface, with view and jitter.""" 
     194    # pylint: disable=unused-argument 
    191195    a, b, c = size 
    192196    x = a*np.array([+1, -1, +1, -1, +1, -1, +1, -1]) 
     
    212216    # in front of the "c+" face.  Use the c face so that rotations about psi 
    213217    # rotate that face. 
    214     if 0: 
     218    if 0: # pylint: disable=using-constant-test 
    215219        color = (1, 0.6, 0.6)  # pink 
    216220        x = a*np.array([+1, -1, +1, -1, +1, -1, +1, -1]) 
     
    229233    ]) 
    230234 
    231 def draw_sphere(axes, radius=0.5, steps=25, 
     235def draw_sphere(axes, radius=1.0, steps=25, 
    232236                center=(0, 0, 0), color='w', alpha=1.): 
    233237    """Draw a sphere""" 
     
    249253    axes.plot([x, x], [y, y], [z, z+dz], color='black') 
    250254 
    251 def draw_person_on_sphere(axes, view, height=0.5, radius=0.5): 
     255def draw_person_on_sphere(axes, view, height=0.5, radius=1.0): 
    252256    """ 
    253257    Draw a person on the surface of a sphere. 
     
    265269    arm_length = torso_length * 0.90 
    266270 
    267     def _draw_part(x, z): 
    268         y = np.zeros_like(x) 
     271    def _draw_part(y, z): 
     272        x = np.zeros_like(y) 
    269273        xp, yp, zp = transform_xyz(view, None, x, y, z + radius) 
    270274        axes.plot(xp, yp, zp, color='k') 
     
    272276    # circle for head 
    273277    u = np.linspace(0, 2 * pi, 40) 
    274     x = head_radius * cos(u) 
     278    y = head_radius * cos(u) 
    275279    z = head_radius * sin(u) + head_height 
    276     _draw_part(x, z) 
     280    _draw_part(y, z) 
    277281 
    278282    # rectangle for body 
    279     x = np.array([-torso_radius, torso_radius, torso_radius, -torso_radius, -torso_radius]) 
     283    y = np.array([-torso_radius, torso_radius, torso_radius, -torso_radius, -torso_radius]) 
    280284    z = np.array([0., 0, torso_length, torso_length, 0]) + leg_length 
    281     _draw_part(x, z) 
     285    _draw_part(y, z) 
    282286 
    283287    # arms 
    284     x = np.array([-torso_radius - limb_offset, -torso_radius - limb_offset, -torso_radius]) 
     288    y = np.array([-torso_radius - limb_offset, -torso_radius - limb_offset, -torso_radius]) 
    285289    z = np.array([shoulder_height - arm_length, shoulder_height, shoulder_height]) 
    286     _draw_part(x, z) 
    287     _draw_part(-x, z) 
     290    _draw_part(y, z) 
     291    _draw_part(-y, z)  # pylint: disable=invalid-unary-operand-type 
    288292 
    289293    # legs 
    290     x = np.array([-torso_radius + limb_offset, -torso_radius + limb_offset]) 
     294    y = np.array([-torso_radius + limb_offset, -torso_radius + limb_offset]) 
    291295    z = np.array([0, leg_length]) 
    292     _draw_part(x, z) 
    293     _draw_part(-x, z) 
     296    _draw_part(y, z) 
     297    _draw_part(-y, z)  # pylint: disable=invalid-unary-operand-type 
    294298 
    295299    limits = [-radius-height, radius+height] 
     
    397401        Should allow free movement in theta, but phi is distorted. 
    398402    """ 
     403    # pylint: disable=unused-argument 
    399404    # TODO: try Kent distribution instead of a gaussian warped by projection 
    400405 
     
    534539 
    535540    # mesh in theta, phi formed by rotating z 
    536     dtheta, dphi, dpsi = jitter 
     541    dtheta, dphi, dpsi = jitter  # pylint: disable=unused-variable 
    537542    z = np.matrix([[0], [0], [radius]]) 
    538543    points = np.hstack([_rotate(theta_i, phi_j, z) 
     
    829834    #print("range",(vmin,vmax)) 
    830835    #qx, qy = np.meshgrid(qx, qy) 
    831     if 0: 
     836    if 0:  # pylint: disable=using-constant-test 
    832837        level = np.asarray(255*(Iqxy - vmin)/(vmax - vmin), 'i') 
    833838        level[level < 0] = 0 
     
    841846        x, y = np.meshgrid(qx/qx.max(), qy/qy.max()) 
    842847        axes.plot_surface(x, y, -1.1*np.ones_like(x), facecolors=colors) 
    843     elif 1: 
     848    elif 1:  # pylint: disable=using-constant-test 
    844849        axes.contourf(qx/qx.max(), qy/qy.max(), Iqxy, zdir='z', offset=-1.1, 
    845850                      levels=np.linspace(vmin, vmax, 24)) 
     
    10191024    # Note: travis-ci does not support mpl_toolkits.mplot3d, but this shouldn't be 
    10201025    # an issue since we are lazy-loading the package on a path that isn't tested. 
    1021     import mpl_toolkits.mplot3d  # Adds projection='3d' option to subplot 
     1026    # Importing mplot3d adds projection='3d' option to subplot 
     1027    import mpl_toolkits.mplot3d  # pylint: disable=unused-variable 
    10221028    import matplotlib as mpl 
    10231029    import matplotlib.pyplot as plt 
     
    10741080    ## callback to draw the new view 
    10751081    def _update(val, axis=None): 
     1082        # pylint: disable=unused-argument 
    10761083        view = stheta.val, sphi.val, spsi.val 
    10771084        jitter = sdtheta.val, sdphi.val, sdpsi.val 
     
    10831090 
    10841091        ## Visualize as person on globe 
    1085         #draw_sphere(axes) 
    1086         #draw_person_on_sphere(axes, view) 
     1092        #draw_sphere(axes, radius=0.5) 
     1093        #draw_person_on_sphere(axes, view, radius=0.5) 
    10871094 
    10881095        ## Move beam instead of shape 
     
    10921099        ## Move shape and draw scattering 
    10931100        draw_beam(axes, (0, 0), alpha=1.) 
     1101        #draw_person_on_sphere(axes, view, radius=1.2, height=0.5) 
    10941102        draw_jitter(axes, view, jitter, dist=dist, size=size, alpha=1., 
    10951103                    draw_shape=draw_shape, projection=projection, views=3) 
     
    12081216    import ipyvolume as ipv 
    12091217 
    1210     class Axes: 
     1218    class Axes(object): 
    12111219        """ 
    12121220        Matplotlib Axes3D style interface to ipyvolume renderer. 
    12131221        """ 
     1222        # pylint: disable=no-self-use,no-init 
    12141223        # transparency can be achieved by setting the following: 
    12151224        #    mesh.color = [r, g, b, alpha] 
     
    12601269        def contourf(self, x, y, v, zdir='z', offset=0, levels=None, **kw): 
    12611270            """mpl style contourf interface for ipyvolume""" 
     1271            # pylint: disable=unused-argument 
    12621272            # Don't use contour for now (although we might want to later) 
    12631273            self.pcolor(x, y, v, zdir='z', offset=offset, **kw) 
    12641274        def pcolor(self, x, y, v, zdir='z', offset=0, **kw): 
    12651275            """mpl style pcolor interface for ipyvolume""" 
     1276            # pylint: disable=unused-argument 
    12661277            x, y, v = make_vec(x, y, v) 
    12671278            image = make_image(v, kw) 
     
    13171328        ## Visualize as person on globe 
    13181329        #draw_beam(axes, (0, 0)) 
    1319         #draw_sphere(axes) 
    1320         #draw_person_on_sphere(axes, view) 
     1330        #draw_sphere(axes, radius=0.5) 
     1331        #draw_person_on_sphere(axes, view, radius=0.5) 
    13211332 
    13221333        ## Move beam instead of shape 
  • sasmodels/kernelcl.py

    rb297ba9 r4e28511  
    115115    Monkey patch pyopencl to allow spaces in include file path. 
    116116    """ 
     117    # pylint: disable=protected-access 
    117118    import pyopencl 
    118119    if hasattr(pyopencl, '_DEFAULT_INCLUDE_OPTIONS'): 
Note: See TracChangeset for help on using the changeset viewer.