Changes between Version 16 and Version 17 of coding_rules
- Timestamp:
- 08/06/20 15:36:41 (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
coding_rules
v16 v17 57 57 bool Test(int a,double b,char* c){ 58 58 }}} 59 == M atlab==59 == MATLAB == 60 60 61 - All matlabroutines should start with a help (Example and See Also are not mandatory):61 - All MATLAB routines should start with a help (Example and See Also are not mandatory): 62 62 {{{ 63 #!m 63 #!matlab 64 64 function outputs=FunctionName(inputs) 65 65 %FUNCTIONNAME - one line description … … 81 81 82 82 {{{ 83 #!m 83 #!matlab 84 84 function outputs=hello() 85 85 %HELLO - prints hello to the screen … … 102 102 flake8 --ignore=E262,E265,F403,F405,E405,E501 103 103 }}} 104 105 === Docstrings === 106 Adhering to [https://www.python.org/dev/peps/pep-0257/ PEP8 Docstring Conventions] while attempting to mirror the conventions we follow under MATLAB, modules, functions, classes, and method definitions should be documented according to the following protocol, 107 108 {{{ 109 #!python 110 def FunctionName(inputs): 111 """FUNCTIONNAME - one line description 112 113 Extensive description of what is being done, inputs 114 outputs, etc... 115 116 Usage: 117 outputs = FunctionName(inputs) 118 119 Example: 120 md.test = FunctionName(1) 121 122 See Also: 123 FunctionName2, FunctionName3, ... 124 """ 125 }}} 126 127 As with MATLAB, at the very least, the first line and the 'Usage' should be provided. Unlike MATLAB, use indentations of 4 and 8 spaces. 104 128 105 129 === MATLAB Built-In Equivalents ===