Skip to content

Commit 1f470e7

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 851c740 commit 1f470e7

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

audio_filters/butterworth_filter.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def make_allpass(
113113
114114
>>> filter = make_allpass(1000, 48000)
115115
>>> filter.a_coeffs + filter.b_coeffs # doctest: +NORMALIZE_WHITESPACE
116-
[1.0922959556412573, -1.9828897227476208, 0.9077040443587427,
116+
[1.0922959556412573, -1.9828897227476208, 0.9077040443587427,
117117
0.9077040443587427, -1.9828897227476208, 1.0922959556412573]
118118
"""
119119
w0 = tau * frequency / samplerate
@@ -173,7 +173,7 @@ def make_lowshelf(
173173
174174
>>> filter = make_lowshelf(1000, 48000, 6)
175175
>>> filter.a_coeffs + filter.b_coeffs # doctest: +NORMALIZE_WHITESPACE
176-
[3.0409336710888786, -5.608870992220748, 2.602157875636628,
176+
[3.0409336710888786, -5.608870992220748, 2.602157875636628,
177177
3.139954022810743, -5.591841778072785, 2.5201667380627257]
178178
"""
179179
w0 = tau * frequency / samplerate
@@ -210,7 +210,7 @@ def make_highshelf(
210210
211211
>>> filter = make_highshelf(1000, 48000, 6)
212212
>>> filter.a_coeffs + filter.b_coeffs # doctest: +NORMALIZE_WHITESPACE
213-
[2.2229172136088806, -3.9587208137297303, 1.7841414181566304,
213+
[2.2229172136088806, -3.9587208137297303, 1.7841414181566304,
214214
4.295432981120543, -7.922740859457287, 3.6756456963725253]
215215
"""
216216
w0 = tau * frequency / samplerate

maths/pythagoras.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Uses Pythagoras theorem
1+
"""Uses Pythagoras theorem
22
to calculate the distance between two points in space."""
33

44
import math
@@ -18,12 +18,11 @@ def distance(a: Point, b: Point) -> float:
1818
"""
1919
>>> point1 = Point(2, -1, 7)
2020
>>> point2 = Point(1, -3, 5)
21-
>>> print(f"Distance from {point1} to {point2}
21+
>>> print(f"Distance from {point1} to {point2}
2222
is {distance(point1, point2)}")
2323
Distance from Point(2, -1, 7) to Point(1, -3, 5) is 3.0
2424
"""
25-
return math.sqrt(abs((b.x - a.x) ** 2 + (b.y - a.y) ** 2
26-
+ (b.z - a.z) ** 2))
25+
return math.sqrt(abs((b.x - a.x) ** 2 + (b.y - a.y) ** 2 + (b.z - a.z) ** 2))
2726

2827

2928
if __name__ == "__main__":

sorts/quick_sort.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,11 @@ def quick_sort(collection: list) -> list:
3535

3636
lesser_partition, greater_partition = partition(collection, pivot)
3737

38-
return [*quick_sort(lesser_partition), pivot,
39-
*quick_sort(greater_partition)]
38+
return [*quick_sort(lesser_partition), pivot, *quick_sort(greater_partition)]
4039

4140

4241
def partition(collection: list, pivot) -> tuple[list, list]:
43-
"""Partition the collection into two lists: elements less
42+
"""Partition the collection into two lists: elements less
4443
than or equal to the pivot, and elements greater than the pivot.
4544
:param collection: a mutable collection of comparable items
4645
:param pivot: the pivot element

0 commit comments

Comments
 (0)