From 1aa2e8875a21e53f7552879e3c85bb229af447af Mon Sep 17 00:00:00 2001 From: Jonathan Rampersad Date: Wed, 5 Nov 2025 18:58:20 -0400 Subject: [PATCH] Made the default values of min/max_range 0.0 --- pyproject.toml | 2 +- src/polysolve/__init__.py | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 7797a57..f0c515f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta" [project] # --- Core Metadata --- name = "polysolve" -version = "0.6.2" +version = "0.6.3" authors = [ { name="Jonathan Rampersad", email="jonathan@jono-rams.work" }, ] diff --git a/src/polysolve/__init__.py b/src/polysolve/__init__.py index 35f9537..c146adb 100644 --- a/src/polysolve/__init__.py +++ b/src/polysolve/__init__.py @@ -70,9 +70,9 @@ class GA_Options: Attributes: 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. - Default: 100.0 + Default: 0.0 num_of_generations (int): The number of iterations the algorithm will run. Default: 10 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 multiple near-identical roots. Default: 5 """ - min_range: float = -100.0 - max_range: float = 100.0 + min_range: float = 0.0 + max_range: float = 0.0 num_of_generations: int = 10 data_size: int = 100000 mutation_strength: float = 0.01 @@ -360,7 +360,7 @@ class Function: random_size = data_size - elite_size - crossover_size - mutation_size # 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: # User hasn't specified a custom range. @@ -489,7 +489,7 @@ class Function: d_coefficients = cupy.array(self.coefficients, dtype=cupy.float64) # 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: # User hasn't specified a custom range.