From af5e35417319b16abb1248b2b2a011a45967f541 Mon Sep 17 00:00:00 2001 From: Jonathan Rampersad Date: Sat, 26 Sep 2026 14:55:29 +0000 Subject: [PATCH] Increase num_of_generarions in get_roots tests. This is to help decrease likelihood of failure due to lower processing times. Failures at these low values can make users incorrectly think the code was broken --- tests/test_polysolve.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test_polysolve.py b/tests/test_polysolve.py index 32803a4..b37c737 100644 --- a/tests/test_polysolve.py +++ b/tests/test_polysolve.py @@ -139,7 +139,7 @@ def test_get_real_roots_numpy(quadratic_func): Tests that the NumPy-based genetic algorithm approximates the roots correctly. """ # Using more generations for higher accuracy in testing - ga_opts = GA_Options(num_of_generations=50, data_size=200000, selection_percentile=0.66, root_precision=3) + ga_opts = GA_Options(num_of_generations=100, data_size=200000, selection_percentile=0.66, root_precision=3) roots = quadratic_func.get_real_roots(ga_opts, use_cuda=False) @@ -158,7 +158,7 @@ def test_get_real_roots_cuda(quadratic_func): It will be skipped automatically if CuPy is not available. """ - ga_opts = GA_Options(num_of_generations=50, data_size=200000, selection_percentile=0.66, root_precision=3) + ga_opts = GA_Options(num_of_generations=100, data_size=200000, selection_percentile=0.66, root_precision=3) roots = quadratic_func.get_real_roots(ga_opts, use_cuda=True) @@ -172,7 +172,7 @@ def test_get_roots_numpy(complex_func): Tests that the NumPy-based genetic algorithm approximates the roots correctly. """ # Using more generations for higher accuracy in testing - ga_opts = GA_Options(num_of_generations=50, data_size=200000, selection_percentile=0.66, root_precision=3) + ga_opts = GA_Options(num_of_generations=100, data_size=200000, selection_percentile=0.66, root_precision=3) roots = complex_func.get_roots(ga_opts, use_cuda=False) @@ -191,7 +191,7 @@ def test_get_roots_cuda(complex_func): It will be skipped automatically if CuPy is not available. """ - ga_opts = GA_Options(num_of_generations=50, data_size=200000, selection_percentile=0.66, root_precision=3) + ga_opts = GA_Options(num_of_generations=100, data_size=200000, selection_percentile=0.66, root_precision=3) roots = complex_func.get_roots(ga_opts, use_cuda=True)