| 205 | '''CLEAN LINT''' |
| 206 | |
| 207 | Run the lint check with: |
| 208 | |
| 209 | {{{ |
| 210 | python -m pylint --rcfile=extra/pylint.rc sasmodels/models/modelname.py |
| 211 | }}} |
| 212 | |
| 213 | |
| 214 | You can tell pylint to ignore things. For example, to align you parameters in blocks: |
| 215 | |
| 216 | {{{#!python |
| 217 | |
| 218 | # pylint: disable=bad-whitespace,line-too-long |
| 219 | # ["name", "units", default, [lower, upper], "type", "description"], |
| 220 | parameters = [ |
| 221 | ["contrast_factor", "barns", 10.0, [-inf, inf], "", "Contrast factor of the polymer"], |
| 222 | ["bjerrum_length", "Ang", 7.1, [0, inf], "", "Bjerrum length"], |
| 223 | ["virial_param", "1/Ang^2", 12.0, [-inf, inf], "", "Virial parameter"], |
| 224 | ["monomer_length", "Ang", 10.0, [0, inf], "", "Monomer length"], |
| 225 | ["salt_concentration", "mol/L", 0.0, [-inf, inf], "", "Concentration of monovalent salt"], |
| 226 | ["ionization_degree", "", 0.05, [0, inf], "", "Degree of ionization"], |
| 227 | ["polymer_concentration", "mol/L", 0.7, [0, inf], "", "Polymer molar concentration"], |
| 228 | ] |
| 229 | # pylint: enable=bad-whitespace,line-too-long |
| 230 | }}} |
| 231 | |
| 232 | We are not aiming for zero lint just yet, only keeping it to a minimum. For now, don't worry about invalid-name or missing-docstring on Iq/Iqxy. If you really want a variable name Rg for example because Rg is the right name for the model parameter, then ignore the lint errors. We will have delinting sessions at the code camp, where we can decide on standards for model files, parameter names, etc. |
| 233 | |
| 234 | |