Ignore:
Timestamp:
Jan 29, 2016 6:02:35 AM (8 years ago)
Author:
piotr
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:
ed82794
Parents:
bf6631a
Message:

pylint prettification

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/polymer_excl_volume.py

    r07a6700 r168052c  
    113113category = "shape-independent" 
    114114 
     115# pylint: disable=bad-whitespace, line-too-long 
    115116#             ["name", "units", default, [lower, upper], "type", "description"], 
    116117parameters = [["rg",        "Ang", 60.0, [0, inf],    "", "Radius of Gyration"], 
    117118              ["porod_exp", "",     3.0, [-inf, inf], "", "Porod exponent"], 
    118               ] 
     119             ] 
     120# pylint: enable=bad-whitespace, line-too-long 
    119121 
    120122 
    121 def Iq(q, rg, porod_exp): 
    122  
     123def Iq(q, 
     124       rg=60.0, 
     125       porod_exp=3.0): 
    123126    """ 
    124127    :param q:         Input q-value (float or [float, float]) 
     
    131134    o2nu = 1.0/(2.0*nu) 
    132135 
    133     intensity = ((1.0/(nu*power(u, o2nu))) * (gamma(o2nu)*gammainc(o2nu, u) - 
     136    intensity = ((1.0/(nu*power(u, o2nu))) * 
     137                 (gamma(o2nu)*gammainc(o2nu, u) - 
    134138                  1.0/power(u, o2nu) * gamma(porod_exp) * 
    135139                  gammainc(porod_exp, u))) * (q > 0) + 1.0*(q <= 0) 
     
    141145 
    142146def Iqxy(qx, qy, *args): 
    143         iq = Iq(sqrt(qx**2 + qy**2), *args) 
     147    """ 
     148    :param qx:   Input q_x-value 
     149    :param qy:   Input q_y-value 
     150    :param args: Remaining arguments 
     151    :return:     2D-Intensity 
     152    """ 
    144153 
    145         return iq 
     154    return Iq(sqrt(qx**2 + qy**2), *args) 
    146155 
    147156Iqxy.vectorized = True  # Iqxy accepts an array of qx, qy values 
     
    158167 
    159168tests = [ 
    160          # Accuracy tests based on content in test/polyexclvol_default_igor.txt 
    161          [{'rg': 60, 'porod_exp': 3.0}, 0.001, 0.998801], 
    162          [{'rg': 60, 'porod_exp': 3.0}, 0.105363, 0.0162751], 
    163          [{'rg': 60, 'porod_exp': 3.0}, 0.665075, 6.56261e-05], 
     169    # Accuracy tests based on content in test/polyexclvol_default_igor.txt 
     170    [{'rg': 60, 'porod_exp': 3.0}, 0.001, 0.998801], 
     171    [{'rg': 60, 'porod_exp': 3.0}, 0.105363, 0.0162751], 
     172    [{'rg': 60, 'porod_exp': 3.0}, 0.665075, 6.56261e-05], 
    164173 
    165          # Additional tests with larger range of parameters 
    166          [{'rg': 10, 'porod_exp': 4.0}, 0.1, 0.723436675809], 
    167          [{'rg': 2.2, 'porod_exp': 22.0, 'background': 100.0}, 5.0, 100.0], 
    168          [{'rg': 1.1, 'porod_exp': 1, 'background': 10.0, 'scale': 1.25}, 
    169          20000., 10.0000712097] 
    170          ] 
     174    # Additional tests with larger range of parameters 
     175    [{'rg': 10, 'porod_exp': 4.0}, 0.1, 0.723436675809], 
     176    [{'rg': 2.2, 'porod_exp': 22.0, 'background': 100.0}, 5.0, 100.0], 
     177    [{'rg': 1.1, 'porod_exp': 1, 'background': 10.0, 'scale': 1.25}, 
     178     20000., 10.0000712097] 
     179    ] 
Note: See TracChangeset for help on using the changeset viewer.