Made further changes to GA_options for get_roots tests
Run Python Tests / test (3.14) (pull_request) Successful in 20s
Run Python Tests / test (3.12) (pull_request) Successful in 37s
Run Python Tests / test (3.8) (pull_request) Successful in 25s
Run Python Tests / test (3.10) (pull_request) Successful in 22s

This commit is contained in:
2026-09-26 14:57:54 +00:00
parent 182af45fdf
commit 7594b27211
+4 -4
View File
@@ -139,7 +139,7 @@ def test_get_real_roots_numpy(quadratic_func):
Tests that the NumPy-based genetic algorithm approximates the roots correctly. Tests that the NumPy-based genetic algorithm approximates the roots correctly.
""" """
# Using more generations for higher accuracy in testing # Using more generations for higher accuracy in testing
ga_opts = GA_Options(num_of_generations=100, data_size=200000, selection_percentile=0.66, root_precision=3) ga_opts = GA_Options(num_of_generations=100, data_size=500000, selection_percentile=0.66, root_precision=2)
roots = quadratic_func.get_real_roots(ga_opts, use_cuda=False) 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. It will be skipped automatically if CuPy is not available.
""" """
ga_opts = GA_Options(num_of_generations=100, data_size=200000, selection_percentile=0.66, root_precision=3) ga_opts = GA_Options(num_of_generations=100, data_size=500000, selection_percentile=0.66, root_precision=2)
roots = quadratic_func.get_real_roots(ga_opts, use_cuda=True) 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. Tests that the NumPy-based genetic algorithm approximates the roots correctly.
""" """
# Using more generations for higher accuracy in testing # Using more generations for higher accuracy in testing
ga_opts = GA_Options(num_of_generations=100, data_size=200000, selection_percentile=0.66, root_precision=3) ga_opts = GA_Options(num_of_generations=100, data_size=500000, selection_percentile=0.66, root_precision=2)
roots = complex_func.get_roots(ga_opts, use_cuda=False) 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. It will be skipped automatically if CuPy is not available.
""" """
ga_opts = GA_Options(num_of_generations=100, data_size=200000, selection_percentile=0.66, root_precision=3) ga_opts = GA_Options(num_of_generations=100, data_size=500000, selection_percentile=0.66, root_precision=2)
roots = complex_func.get_roots(ga_opts, use_cuda=True) roots = complex_func.get_roots(ga_opts, use_cuda=True)