Skip to content

Commit 76b66f9

Browse files
committed
Fix some more numpy tests
1 parent c424e8b commit 76b66f9

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

data_structures/heap/binomial_heap.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class BinomialHeap:
7373
30
7474
7575
Deleting - delete() test
76-
>>> [first_heap.delete_min() for _ in range(20)]
76+
>>> [int(first_heap.delete_min()) for _ in range(20)]
7777
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]
7878
7979
Create a new Heap

electronics/circular_convolution.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def circular_convolution(self) -> list[float]:
3939
Usage:
4040
>>> convolution = CircularConvolution()
4141
>>> convolution.circular_convolution()
42-
[10, 10, 6, 14]
42+
[10.0 10.0, 6.0, 14.0]
4343
4444
>>> convolution.first_signal = [0.2, 0.4, 0.6, 0.8, 1.0, 1.2, 1.4, 1.6]
4545
>>> convolution.second_signal = [0.1, 0.3, 0.5, 0.7, 0.9, 1.1, 1.3, 1.5]

fractals/julia_sets.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ def eval_exponential(c_parameter: complex, z_values: np.ndarray) -> np.ndarray:
4242
Evaluate $e^z + c$.
4343
>>> float(eval_exponential(0, 0))
4444
1.0
45-
>>> abs(eval_exponential(1, np.pi*1.j)) < 1e-15
45+
>>> bool(abs(eval_exponential(1, np.pi*1.j)) < 1e-15)
4646
True
47-
>>> abs(eval_exponential(1.j, 0)-1-1.j) < 1e-15
47+
>>> bool(abs(eval_exponential(1.j, 0)-1-1.j) < 1e-15)
4848
True
4949
"""
5050
return np.exp(z_values) + c_parameter

graphics/bezier_curve.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ def bezier_curve_function(self, t: float) -> tuple[float, float]:
5555
The last point in the curve is when t = 1.
5656
5757
>>> curve = BezierCurve([(1,1), (1,2)])
58-
>>> [float(x) for x in curve.bezier_curve_function(0)]
58+
>>> tuple(float(x) for x in curve.bezier_curve_function(0))
5959
(1.0, 1.0)
60-
>>> [float(x) for x in curve.bezier_curve_function(1)]
60+
>>> tuple(float(x) for x in curve.bezier_curve_function(1))
6161
(1.0, 2.0)
6262
"""
6363

neural_network/two_hidden_layers_neural_network.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def back_propagation(self) -> None:
105105
>>> res = nn.feedforward()
106106
>>> nn.back_propagation()
107107
>>> updated_weights = nn.second_hidden_layer_and_output_layer_weights
108-
>>> (res == updated_weights).all()
108+
>>> bool((res == updated_weights).all())
109109
False
110110
"""
111111

0 commit comments

Comments
 (0)