Changes between Version 1 and Version 2 of DevNotes/DevGuide/CodingRules


Ignore:
Timestamp:
May 27, 2016 5:43:59 PM (9 years ago)
Author:
wojciech
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • DevNotes/DevGuide/CodingRules

    v1 v2  
    3232 
    3333Coding Standards 
     34 
    3435Docstring 
    3536 
    36 When in doubt, the best is to follow PEP 257 (https://www.python.org/dev/peps/pep-0257/). A few rules that are particularly recommended to follow are mentioned below: 
     37    When in doubt, the best is to follow PEP 257 (https://www.python.org/dev/peps/pep-0257/). A few rules that are particularly recommended to follow are mentioned below: 
    3738 
    3839    All modules should normally have docstrings, and all functions and classes exported by a module should also have docstrings. 
     
    4647      
    4748    Models: when adding a new model the .py file starts with an r (for raw) and three sets of quotes to start the doc string and ends with a second set of 3 quotes. 
    48     Models: wherever possible, try to use images of math functions with Latex equivalents. You can use the live demo Mathjax page ( http://www.mathjax.org/) to make sure the equation looks as expected. Also a lot of the Latex code can be taken from (or edited) from the PDF document created by Paul Kienzle:  http://sasview.org/attachment/wiki/SasModels%20Work%20Package/Equations.docx.pdf. 
     49    Models: wherever possible, try to use images of math functions with Latex equivalents. You can use the live demo Mathjax page ( http://www.mathjax.org/) to make sure the equation looks as expected. Also a lot of the Latex code can be taken from (or edited) from the PDF document created by Paul Kienzle:  [http://sasview.org/attachment/wiki/SasModels%20Work%20Package/Equations.docx.pdf] 
    4950    Models: don't add/remove the table of parameters which will get autogenerated. 
    5051    Models: add non-math figures to the sasmodels/sasmodels/models/img subdirectory and rename them to something sensible. 
    51     Models: figure captions should be indented relative to the ..image:: tag. This allows us to, for example, change the font of the caption through CSS. 
     52    Models: figure captions should be indented relative to the image tag. This allows us to, for example, change the font of the caption through CSS. 
    5253    Models: don't add the figure number since this will be generated automatically. 
    5354    Models: make sure all references to model parameters are appropriately named, and that the relationship between equation variables and model parameters are obvious. 
     
    168169 
    169170Both PyCharm and VS allow source level debugging both of self-spawned processes and by attaching to an already running process. 
     171 
    170172API 
    171173