Skip to content

Commit d48661e

Browse files
cclaussgithub-actions
and
github-actions
authored
CONTRIBUTING.md: What is an Algorithm? (#1885)
* CONTRIBUTING.md: What is an Algorithm? We are seeing too many _how-to examples_ for using existing Python packages so we should define what we want algorithm contributions to be. * updating DIRECTORY.md Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
1 parent b64c4af commit d48661e

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

CONTRIBUTING.md

+22
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,28 @@ Your contribution will be tested by our [automated testing on Travis CI](https:/
2727

2828
Please help us keep our issue list small by adding fixes: #{$ISSUE_NO} to the commit message of pull requests that resolve open issues. GitHub will use this tag to auto close the issue when the PR is merged.
2929

30+
#### What is an Algorithm?
31+
32+
An Algorithm is one or more functions (or classes) that:
33+
* take one or more inputs,
34+
* perform some internal calculations or data manipulations,
35+
* return one or more outputs,
36+
* have minimal side effects (Ex. print(), plot(), read(), write()).
37+
38+
Algorithms should be packaged in a way that would make it easy for readers to put them into larger programs.
39+
40+
Algorithms should:
41+
* have intuitive class and function names that make their purpose clear to readers
42+
* use Python naming conventions and intuitive variable names to ease comprehension
43+
* be flexible to take different input values
44+
* have Python type hints for their input parameters and return values
45+
* raise Python exceptions (ValueError, etc.) on erroneous input values
46+
* have docstrings with clear explanations and/or URLs to source materials
47+
* contain doctests that test both valid and erroneous input values
48+
* return all calculation results instead of printing or plotting them
49+
50+
Algorithms in this repo should not be how-to examples for existing Python packages. Instead, they should perform internal calculations or manipulations to convert input values into different output values. Those calculations or manipulations can use data types, classes, or functions of existing Python packages but each algorithm in this repo should add unique value.
51+
3052
#### Coding Style
3153

3254
We want your work to be readable by others; therefore, we encourage you to note the following:

DIRECTORY.md

+1
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,7 @@
252252

253253
## Machine Learning
254254
* [Decision Tree](https://github.com/TheAlgorithms/Python/blob/master/machine_learning/decision_tree.py)
255+
* [Gaussian Naive Bayes](https://github.com/TheAlgorithms/Python/blob/master/machine_learning/gaussian_naive_bayes.py)
255256
* [Gradient Descent](https://github.com/TheAlgorithms/Python/blob/master/machine_learning/gradient_descent.py)
256257
* [K Means Clust](https://github.com/TheAlgorithms/Python/blob/master/machine_learning/k_means_clust.py)
257258
* [K Nearest Neighbours](https://github.com/TheAlgorithms/Python/blob/master/machine_learning/k_nearest_neighbours.py)

0 commit comments

Comments
 (0)