Ignore:
Timestamp:
Aug 8, 2016 11:24:11 AM (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:
2472141
Parents:
2d65d51
Message:

lint and latex cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/polymer_excl_volume.py

    r2c74c11 r40a87fa  
    106106 
    107107# pylint: disable=bad-whitespace, line-too-long 
    108 #             ["name", "units", default, [lower, upper], "type", "description"], 
    109 parameters = [["rg",        "Ang", 60.0, [0, inf],    "", "Radius of Gyration"], 
    110               ["porod_exp", "",     3.0, [-inf, inf], "", "Porod exponent"], 
    111              ] 
     108#   ["name", "units", default, [lower, upper], "type", "description"], 
     109parameters = [ 
     110    ["rg",        "Ang", 60.0, [0, inf],    "", "Radius of Gyration"], 
     111    ["porod_exp", "",     3.0, [-inf, inf], "", "Porod exponent"], 
     112] 
    112113# pylint: enable=bad-whitespace, line-too-long 
    113114 
     
    120121    :return:          Calculated intensity 
    121122    """ 
    122     u = (q*rg)**2 * (2.0/porod_exp + 1.0) * (2.0/porod_exp + 2.0)/6.0 
     123    usub = (q*rg)**2 * (2.0/porod_exp + 1.0) * (2.0/porod_exp + 2.0)/6.0 
    123124    with errstate(divide='ignore', invalid='ignore'): 
    124         upow = power(u, -0.5*porod_exp) 
    125         iq = (porod_exp*upow * 
    126               (gamma(0.5*porod_exp)*gammainc(0.5*porod_exp, u) - 
    127                upow*gamma(porod_exp)*gammainc(porod_exp, u))) 
    128     iq[q <= 0] = 1.0 
     125        upow = power(usub, -0.5*porod_exp) 
     126        result= (porod_exp*upow * 
     127                 (gamma(0.5*porod_exp)*gammainc(0.5*porod_exp, usub) - 
     128                  upow*gamma(porod_exp)*gammainc(porod_exp, usub))) 
     129    result[q <= 0] = 1.0 
    129130 
    130     return iq 
     131    return result 
    131132 
    132133Iq.vectorized = True  # Iq accepts an array of q values 
    133  
    134134 
    135135tests = [ 
Note: See TracChangeset for help on using the changeset viewer.