Made the default values of min/max_range 0.0
All checks were successful
Run Python Tests / test (3.10) (pull_request) Successful in 14s
Run Python Tests / test (3.12) (pull_request) Successful in 26s
Run Python Tests / test (3.8) (pull_request) Successful in 14s
Publish Python Package to PyPI / deploy (push) Successful in 12s

This commit was merged in pull request #24.
This commit is contained in:
2025-11-05 18:58:20 -04:00
parent 94723dcb88
commit 1aa2e8875a
2 changed files with 7 additions and 7 deletions

View File

@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
[project] [project]
# --- Core Metadata --- # --- Core Metadata ---
name = "polysolve" name = "polysolve"
version = "0.6.2" version = "0.6.3"
authors = [ authors = [
{ name="Jonathan Rampersad", email="jonathan@jono-rams.work" }, { name="Jonathan Rampersad", email="jonathan@jono-rams.work" },
] ]

View File

@@ -70,9 +70,9 @@ class GA_Options:
Attributes: Attributes:
min_range (float): The minimum value for the initial random solutions. min_range (float): The minimum value for the initial random solutions.
Default: -100.0 Default: 0.0
max_range (float): The maximum value for the initial random solutions. max_range (float): The maximum value for the initial random solutions.
Default: 100.0 Default: 0.0
num_of_generations (int): The number of iterations the algorithm will run. num_of_generations (int): The number of iterations the algorithm will run.
Default: 10 Default: 10
data_size (int): The total number of solutions (population size) data_size (int): The total number of solutions (population size)
@@ -104,8 +104,8 @@ class GA_Options:
(e.g., 7) is more precise but may return (e.g., 7) is more precise but may return
multiple near-identical roots. Default: 5 multiple near-identical roots. Default: 5
""" """
min_range: float = -100.0 min_range: float = 0.0
max_range: float = 100.0 max_range: float = 0.0
num_of_generations: int = 10 num_of_generations: int = 10
data_size: int = 100000 data_size: int = 100000
mutation_strength: float = 0.01 mutation_strength: float = 0.01
@@ -360,7 +360,7 @@ class Function:
random_size = data_size - elite_size - crossover_size - mutation_size random_size = data_size - elite_size - crossover_size - mutation_size
# Check if the user is using the default, non-expert range # Check if the user is using the default, non-expert range
user_range_is_default = (options.min_range == -100.0 and options.max_range == 100.0) user_range_is_default = (options.min_range == 0.0 and options.max_range == 0.0)
if user_range_is_default: if user_range_is_default:
# User hasn't specified a custom range. # User hasn't specified a custom range.
@@ -489,7 +489,7 @@ class Function:
d_coefficients = cupy.array(self.coefficients, dtype=cupy.float64) d_coefficients = cupy.array(self.coefficients, dtype=cupy.float64)
# Check if the user is using the default, non-expert range # Check if the user is using the default, non-expert range
user_range_is_default = (options.min_range == -100.0 and options.max_range == 100.0) user_range_is_default = (options.min_range == 0.0 and options.max_range == 0.0)
if user_range_is_default: if user_range_is_default:
# User hasn't specified a custom range. # User hasn't specified a custom range.