Format docs (#7821) · zinating/algorithms-python@cf08d9f · GitHub
Skip to content

Commit cf08d9f

Browse files
CjkjvfnbyCaedenPH
andauthored
Format docs (TheAlgorithms#7821)
* Reformat docs for odd_even_sort.py * Fix docstring formatting * Apply suggestions from code review Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com> Co-authored-by: Caeden Perelli-Harris <caedenperelliharris@gmail.com>
1 parent 762afc0 commit cf08d9f

4 files changed

Lines changed: 24 additions & 9 deletions

File tree

machine_learning/data_transformations.py

Lines changed: 7 additions & 3 deletions

physics/kinetic_energy.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""
2-
Find the kinetic energy of an object, give its mass and velocity
2+
Find the kinetic energy of an object, given its mass and velocity.
3+
34
Description : In physics, the kinetic energy of an object is the energy that it
45
possesses due to its motion. It is defined as the work needed to accelerate a body of a
56
given mass from rest to its stated velocity. Having gained this energy during its
@@ -19,6 +20,8 @@
1920

2021
def kinetic_energy(mass: float, velocity: float) -> float:
2122
"""
23+
Calculate kinetick energy.
24+
2225
The kinetic energy of a non-rotating object of mass m traveling at a speed v is ½mv²
2326
2427
>>> kinetic_energy(10,10)

sorts/merge_sort.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""
2-
This is a pure Python implementation of the merge sort algorithm
2+
This is a pure Python implementation of the merge sort algorithm.
3+
34
For doctests run following command:
45
python -m doctest -v merge_sort.py
56
or
@@ -10,7 +11,7 @@
1011

1112

1213
def merge_sort(collection: list) -> list:
13-
"""Pure implementation of the merge sort algorithm in Python
14+
"""
1415
:param collection: some mutable ordered collection with heterogeneous
1516
comparable items inside
1617
:return: the same collection ordered by ascending
@@ -24,7 +25,9 @@ def merge_sort(collection: list) -> list:
2425
"""
2526

2627
def merge(left: list, right: list) -> list:
27-
"""merge left and right
28+
"""
29+
Merge left and right.
30+
2831
:param left: left collection
2932
:param right: right collection
3033
:return: merge result

sorts/odd_even_sort.py

Lines changed: 7 additions & 2 deletions

0 commit comments

Comments
 (0)