You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+17-13Lines changed: 17 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -45,12 +45,12 @@ GitHub will use this tag to [auto-close the issue](https://docs.github.com/en/is
45
45
#### What is an Algorithm?
46
46
47
47
An algorithm is one or more functions (or classes) that:
48
-
* take one or more inputs,
49
-
* perform some internal calculations or data manipulations,
50
-
* return one or more outputs,
51
-
* have minimal side effects (e.g., `print()`, `plot()`, `read()`, `write()`).
52
-
An Algorithm is one or more functions (or classes) that:
53
48
49
+
- take one or more inputs,
50
+
- perform some internal calculations or data manipulations,
51
+
- return one or more outputs,
52
+
- have minimal side effects (e.g., `print()`, `plot()`, `read()`, `write()`).
53
+
An Algorithm is one or more functions (or classes) that:
54
54
- take one or more inputs,
55
55
- perform some internal calculations or data manipulations,
56
56
- return one or more outputs,
@@ -59,14 +59,15 @@ An Algorithm is one or more functions (or classes) that:
59
59
Algorithms should be packaged in a way that would make it easy for readers to integrate them into larger programs.
60
60
61
61
Algorithms should:
62
-
* have intuitive class and function names that make their purpose clear to readers,
63
-
* use Python naming conventions and intuitive variable names to ease comprehension,
64
-
* be flexible to take different input values,
65
-
* have Python type hints for their input parameters and return values,
66
-
* raise Python exceptions (`ValueError`, etc.) on erroneous input values,
67
-
* have docstrings with clear explanations and/or URLs to source materials,
68
-
* contain doctests that test both valid and erroneous input values,
69
-
* return all calculation results instead of printing or plotting them.
62
+
63
+
- have intuitive class and function names that make their purpose clear to readers,
64
+
- use Python naming conventions and intuitive variable names to ease comprehension,
65
+
- be flexible to take different input values,
66
+
- have Python type hints for their input parameters and return values,
67
+
- raise Python exceptions (`ValueError`, etc.) on erroneous input values,
68
+
- have docstrings with clear explanations and/or URLs to source materials,
69
+
- contain doctests that test both valid and erroneous input values,
70
+
- return all calculation results instead of printing or plotting them.
70
71
71
72
Algorithms in this repo should not be simple how-to examples for existing Python packages. Instead, they should perform internal calculations or manipulations to convert input values into different output values. These calculations or manipulations can use data types, classes, or functions of existing Python packages, but each algorithm in this repo should add unique value.
72
73
@@ -92,13 +93,15 @@ Use [pre-commit](https://pre-commit.com/#installation) to automatically format y
92
93
python3 -m pip install pre-commit # only required the first time
93
94
pre-commit install
94
95
```
96
+
95
97
That's it! The plugin will run every time you commit any changes. If there are any errors found during the run, fix them and commit those changes. You can even run the plugin manually on all files:
96
98
97
99
That's it! The plugin will run every time you commit any changes. If any errors are found during the run, fix them and commit those changes. You can even run the plugin manually on all files:
98
100
99
101
```bash
100
102
pre-commit run --all-files --show-diff-on-failure
101
103
```
104
+
102
105
#### Coding Style
103
106
104
107
We want your work to be readable by others; therefore, we encourage you to note the following:
@@ -125,6 +128,7 @@ We want your work to be readable by others; therefore, we encourage you to note
125
128
python3 -m pip install ruff # only required the first time
126
129
ruff check
127
130
```
131
+
128
132
- Original code submission require docstrings or comments to describe your work.
129
133
130
134
- Original code submissions require docstrings or comments to describe your work.
0 commit comments