Changeset dcdf29d in sasmodels


Ignore:
Timestamp:
Feb 2, 2016 5:51:27 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:
7f47777, 8007311
Parents:
577912b
Message:

pylint cleanup

Location:
sasmodels/models
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • sasmodels/models/barbell.py

    reb69cce rdcdf29d  
    100100title = "Cylinder with spherical end caps" 
    101101description = """ 
    102         Calculates the scattering from a barbell-shaped cylinder. That is a sphereocylinder with spherical end caps that have a radius larger than that of the cylinder and the center of the end cap 
    103         radius lies outside of the cylinder. 
    104         Note: As the length of cylinder(bar) -->0,it becomes a dumbbell. And when rad_bar = rad_bell, it is a spherocylinder. 
    105         It must be that rad_bar <(=) rad_bell. 
     102    Calculates the scattering from a barbell-shaped cylinder. 
     103    That is a sphereocylinder with spherical end caps that have a radius larger 
     104    than that of the cylinder and the center of the end cap radius lies outside 
     105    of the cylinder. 
     106    Note: As the length of cylinder(bar) -->0,it becomes a dumbbell. And when 
     107    rad_bar = rad_bell, it is a spherocylinder. 
     108    It must be that rad_bar <(=) rad_bell. 
    106109""" 
    107110category = "shape:cylinder" 
    108  
     111# pylint: disable=bad-whitespace, line-too-long 
    109112#             ["name", "units", default, [lower, upper], "type","description"], 
    110 parameters = [["sld", "4e-6/Ang^2", 4, [-inf, inf], "", "Barbell scattering length density"], 
    111               ["solvent_sld", "1e-6/Ang^2", 1, [-inf, inf], "", "Solvent scattering length density"], 
    112               ["bell_radius", "Ang", 40, [0, inf], "volume", "Spherical bell radius"], 
    113               ["radius", "Ang", 20, [0, inf], "volume", "Cylindrical bar radius"], 
    114               ["length", "Ang", 400, [0, inf], "volume", "Cylinder bar length"], 
    115               ["theta", "degrees", 60, [-inf, inf], "orientation", "In plane angle"], 
    116               ["phi", "degrees", 60, [-inf, inf], "orientation", "Out of plane angle"], 
     113parameters = [["sld",         "4e-6/Ang^2",   4, [-inf, inf], "",            "Barbell scattering length density"], 
     114              ["solvent_sld", "1e-6/Ang^2",   1, [-inf, inf], "",            "Solvent scattering length density"], 
     115              ["bell_radius", "Ang",         40, [0, inf],    "volume",      "Spherical bell radius"], 
     116              ["radius",      "Ang",         20, [0, inf],    "volume",      "Cylindrical bar radius"], 
     117              ["length",      "Ang",        400, [0, inf],    "volume",      "Cylinder bar length"], 
     118              ["theta",       "degrees",    60, [-inf, inf], "orientation", "In plane angle"], 
     119              ["phi",         "degrees",    60, [-inf, inf], "orientation", "Out of plane angle"], 
    117120             ] 
     121# pylint: enable=bad-whitespace, line-too-long 
    118122 
    119123source = ["lib/J1.c", "lib/gauss76.c", "barbell.c"] 
  • sasmodels/models/bcc.py

    reb69cce rdcdf29d  
    109109title = "Body-centred cubic lattic with paracrystalline distortion" 
    110110description = """ 
    111     Calculates the scattering from a **body-centered cubic lattice** with paracrystalline distortion. Thermal vibrations 
    112     are considered to be negligible, and the size of the paracrystal is infinitely large. Paracrystalline distortion is 
    113     assumed to be isotropic and characterized by a Gaussian distribution. 
     111    Calculates the scattering from a **body-centered cubic lattice** with 
     112    paracrystalline distortion. Thermal vibrations are considered to be 
     113    negligible, and the size of the paracrystal is infinitely large. 
     114    Paracrystalline distortion is assumed to be isotropic and characterized 
     115    by a Gaussian distribution. 
    114116    """ 
    115117category = "shape:paracrystal" 
    116  
     118# pylint: disable=bad-whitespace, line-too-long 
    117119#             ["name", "units", default, [lower, upper], "type","description" ], 
    118 parameters = [["dnn", "Ang", 220, [-inf, inf], "", "Nearest neighbour distance"], 
    119               ["d_factor", "", 0.06, [-inf, inf], "", "Paracrystal distortion factor"], 
    120               ["radius", "Ang", 40, [0, inf], "volume", "Particle radius"], 
    121               ["sld", "1e-6/Ang^2", 4, [-inf, inf], "", "Particle scattering length density"], 
    122               ["solvent_sld", "1e-6/Ang^2", 1, [-inf, inf], "", "Solvent scattering length density"], 
    123               ["theta", "degrees", 60, [-inf, inf], "orientation", "In plane angle"], 
    124               ["phi", "degrees", 60, [-inf, inf], "orientation", "Out of plane angle"], 
    125               ["psi", "degrees", 60, [-inf, inf], "orientation", "Out of plane angle"] 
     120parameters = [["dnn",         "Ang",       220,    [-inf, inf], "",            "Nearest neighbour distance"], 
     121              ["d_factor",    "",            0.06, [-inf, inf], "",            "Paracrystal distortion factor"], 
     122              ["radius",      "Ang",        40,    [0, inf],    "volume",      "Particle radius"], 
     123              ["sld",         "1e-6/Ang^2",  4,    [-inf, inf], "",            "Particle scattering length density"], 
     124              ["solvent_sld", "1e-6/Ang^2",  1,    [-inf, inf], "",            "Solvent scattering length density"], 
     125              ["theta",       "degrees",    60,    [-inf, inf], "orientation", "In plane angle"], 
     126              ["phi",         "degrees",    60,    [-inf, inf], "orientation", "Out of plane angle"], 
     127              ["psi",         "degrees",    60,    [-inf, inf], "orientation", "Out of plane angle"] 
    126128             ] 
     129# pylint: enable=bad-whitespace, line-too-long 
    127130 
    128131source = ["lib/J1.c", "lib/gauss150.c", "bcc.c"] 
  • sasmodels/models/broad_peak.py

    reb69cce rdcdf29d  
    6060category = "shape-independent" 
    6161 
     62# pylint: disable=bad-whitespace, line-too-long 
    6263#             ["name", "units", default, [lower, upper], "type", "description"], 
    63 parameters = [["porod_scale", "", 1.0e-05, [-inf, inf], "", "Power law scale factor"], 
    64               ["porod_exp", "", 3.0, [-inf, inf], "", "Exponent of power law"], 
    65               ["lorentz_scale", "", 10.0, [-inf, inf], "", "Scale factor for broad Lorentzian peak"], 
    66               ["lorentz_length", "Ang", 50.0, [-inf, inf], "", "Lorentzian screening length"], 
    67               ["peak_pos", "1/Ang", 0.1, [-inf, inf], "", "Peak postion in q"], 
    68               ["lorentz_exp", "", 2.0, [-inf, inf], "", "exponent of Lorentz function"], 
     64parameters = [["porod_scale",    "", 1.0e-05, [-inf, inf], "", "Power law scale factor"], 
     65              ["porod_exp",      "",      3.0, [-inf, inf], "", "Exponent of power law"], 
     66              ["lorentz_scale",  "",    10.0, [-inf, inf], "", "Scale factor for broad Lorentzian peak"], 
     67              ["lorentz_length", "Ang",  50.0, [-inf, inf], "", "Lorentzian screening length"], 
     68              ["peak_pos",       "1/Ang", 0.1, [-inf, inf], "", "Peak position in q"], 
     69              ["lorentz_exp",    "",      2.0, [-inf, inf], "", "Exponent of Lorentz function"], 
    6970             ] 
     71# pylint: enable=bad-whitespace, line-too-long 
    7072 
    71 def Iq(q, porod_scale, porod_exp, lorentz_scale, lorentz_length, peak_pos, lorentz_exp): 
     73def Iq(q, 
     74       porod_scale=1.0e-5, 
     75       porod_exp=3.0, 
     76       lorentz_scale=10.0, 
     77       lorentz_length=50.0, 
     78       peak_pos=0.1, 
     79       lorentz_exp=2.0): 
     80    """ 
     81    :param q:              Input q-value 
     82    :param porod_scale:    Power law scale factor 
     83    :param porod_exp:      Exponent of power law 
     84    :param lorentz_scale:  Scale factor for broad Lorentzian peak 
     85    :param lorentz_length: Lorentzian screening length 
     86    :param peak_pos:       Peak position in q 
     87    :param lorentz_exp:    Exponent of Lorentz function 
     88    :return:               Calculated intensity 
     89    """ 
     90 
    7291    inten = (porod_scale / q ** porod_exp + lorentz_scale 
    7392             / (1.0 + (abs(q - peak_pos) * lorentz_length) ** lorentz_exp)) 
     
    7695 
    7796def Iqxy(qx, qy, *args): 
     97    """ 
     98    :param qx:   Input q_x-value 
     99    :param qy:   Input q_y-value 
     100    :param args: Remaining arguments 
     101    :return:     2D-Intensity 
     102    """ 
    78103    return Iq(sqrt(qx ** 2 + qy ** 2), *args) 
     104 
    79105Iqxy.vectorized = True # Iqxy accepts an array of qx, qy values 
    80  
    81106 
    82107demo = dict(scale=1, background=0, 
  • sasmodels/models/capped_cylinder.py

    reb69cce rdcdf29d  
    125125""" 
    126126category = "shape:cylinder" 
     127# pylint: disable=bad-whitespace, line-too-long 
     128#             ["name", "units", default, [lower, upper], "type", "description"], 
     129parameters = [["sld",         "1e-6/Ang^2", 4, [-inf, inf], "",       "Cylinder scattering length density"], 
     130              ["solvent_sld", "1e-6/Ang^2", 1, [-inf, inf], "",       "Solvent scattering length density"], 
     131              ["radius",      "Ang",       20, [0, inf],    "volume", "Cylinder radius"], 
    127132 
    128 #             ["name", "units", default, [lower, upper], "type", "description"], 
    129 parameters = [["sld", "1e-6/Ang^2", 4, [-inf, inf], "", 
    130                "Cylinder scattering length density"], 
    131               ["solvent_sld", "1e-6/Ang^2", 1, [-inf, inf], "", 
    132                "Solvent scattering length density"], 
    133               ["radius", "Ang", 20, [0, inf], "volume", "Cylinder radius"], 
    134133              # TODO: use an expression for cap radius with fixed bounds. 
    135134              # The current form requires cap radius R bigger than cylinder radius r. 
     
    141140              # in the capped cylinder, and zero for no bar in the barbell model.  In 
    142141              # both models, one would be a pill. 
    143               ["cap_radius", "Ang", 20, [0, inf], "volume", "Cap radius"], 
    144               ["length", "Ang", 400, [0, inf], "volume", "Cylinder length"], 
    145               ["theta", "degrees", 60, [-inf, inf], "orientation", "In plane angle"], 
    146               ["phi", "degrees", 60, [-inf, inf], "orientation", "Out of plane angle"], 
     142              ["cap_radius", "Ang",     20, [0, inf],    "volume", "Cap radius"], 
     143              ["length",     "Ang",    400, [0, inf],    "volume", "Cylinder length"], 
     144              ["theta",      "degrees", 60, [-inf, inf], "orientation", "In plane angle"], 
     145              ["phi",        "degrees", 60, [-inf, inf], "orientation", "Out of plane angle"], 
    147146             ] 
     147# pylint: enable=bad-whitespace, line-too-long 
    148148 
    149149source = ["lib/J1.c", "lib/gauss76.c", "capped_cylinder.c"] 
     
    159159            phi_pd=15, phi_pd_n=1) 
    160160oldname = 'CappedCylinderModel' 
    161 oldpars = dict(sld='sld_capcyl', solvent_sld='sld_solv', 
    162                length='len_cyl', radius='rad_cyl', cap_radius='rad_cap') 
     161oldpars = dict(sld='sld_capcyl', 
     162               solvent_sld='sld_solv', 
     163               length='len_cyl', 
     164               radius='rad_cyl', 
     165               cap_radius='rad_cap') 
Note: See TracChangeset for help on using the changeset viewer.