Changes between Version 1 and Version 2 of DevNotes/DevGuide/CodingRules
- Timestamp:
- May 27, 2016 5:43:59 PM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
DevNotes/DevGuide/CodingRules
v1 v2 32 32 33 33 Coding Standards 34 34 35 Docstring 35 36 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: 37 38 38 39 All modules should normally have docstrings, and all functions and classes exported by a module should also have docstrings. … … 46 47 47 48 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] 49 50 Models: don't add/remove the table of parameters which will get autogenerated. 50 51 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. 52 53 Models: don't add the figure number since this will be generated automatically. 53 54 Models: make sure all references to model parameters are appropriately named, and that the relationship between equation variables and model parameters are obvious. … … 168 169 169 170 Both PyCharm and VS allow source level debugging both of self-spawned processes and by attaching to an already running process. 171 170 172 API 171 173