Changes between Version 24 and Version 25 of DevNotes/DevGuide/CodingRules
- Timestamp:
- May 31, 2016 4:25:43 AM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
DevNotes/DevGuide/CodingRules
v24 v25 5 5 The following document is divided into subsections (Some of these needs to be written) 6 6 7 * Golden Rule 8 * Coding Standards 9 * Docstring 10 * Naming 11 * Imports 12 * Exception Handling 13 * Coding Style 14 15 * Testing 16 * GIT 17 * Code reviews 18 * Code Editors (Not sure if we want to include it) 19 * GUI guidelines (to be included in the future) 20 * API interface (to be included in the future) 21 7 * [#point1 Golden Rule ] 8 * [#point2 Coding Standards] 9 * [#point3 Docstring] 10 * [#point4 Naming] 11 * [#point5 Imports] 12 * [#point6 Exception Handling] 13 * [#point7 Coding Style] 14 15 * [#point8 Testing] 16 * [#point9 GIT] 17 * [#point10 Code reviews] 18 * [#point11 API interface (to be included in the future)] 19 * [#point12 Code Editors (Not sure if we want to include it)] 20 * [#point13 GUI guidelines (to be included in the future)] 21 22 [=#point1] 22 23 == Golden Rule: == 23 24 … … 25 26 '''If you do break the build - the no. 1 priority is to fix it IMMEDIATELY.''' 26 27 28 [=#point2] 27 29 == Coding Standards == 28 30 31 [=#point3] 29 32 Docstring 30 33 … … 47 50 * Models: make sure all references to model parameters are appropriately named, and that the relationship between equation variables and model parameters are obvious. 48 51 52 [=#point4] 49 53 Naming 50 54 … … 80 84 * Models: When defining parameters use radius_core, sld_core names not core_radius and core_sld 81 85 86 [=#point5] 82 87 Imports 83 88 … … 113 118 * Put a blank line between each group of imports. 114 119 120 [=#point6] 115 121 Exception Handling 116 122 … … 121 127 * Never use a blank except: statement since it interferes with !KeyboardInterrupt. At a minimum, use except Exception:. 122 128 123 129 [=#point7] 124 130 Coding Style 125 131 … … 164 170 * Use inline comments (sparingly) to clarify confusing lines. 165 171 172 [=#point8] 166 173 == Testing == 167 174 … … 178 185 * Models: Remember to test a model for critical values (e.g. q=0) 179 186 187 [=#point9] 180 188 == GIT == 181 189 … … 185 193 * When merging a branch with multiple commits use --squash or interactively rebase before pushing to master. 186 194 195 [=#point10] 187 196 == Code Reviews == 188 197 … … 198 207 7. Verify that the defects are actually fixed 199 208 209 [=#point11] 200 210 == Editors == 201 211 … … 208 218 * Both !PyCharm and VS allow source level debugging both of self-spawned processes and by attaching to an already running process. 209 219 220 [=#point12] 210 221 == API == 211 222