refactor!: migrate to modern numpy API, patch root solving, and bump dependencies
Run Python Tests / test (3.10) (pull_request) Successful in 21s
Run Python Tests / test (3.12) (pull_request) Successful in 26s
Run Python Tests / test (3.14) (pull_request) Successful in 20s

- Drop support for Python 3.8.
- Bump minimum dependencies to `numpy>=2.0` and `numba>=0.60`.
- Replace legacy NumPy polynomial functions (polyder, polyadd, etc.) with
  the modern `numpy.polynomial.Polynomial` class for stable calculus and
  arithmetic operations.
- Remove `_strip_leading_zeros` as the modern API handles degree alignment
  and zero-trimming natively.
- Retain highest-to-lowest `self.coefficients` array to maintain compatibility
  with Numba and CUDA GPU kernels evaluating via Horner's method.
- Fix `TypeError` in `quadratic_solve` by evaluating `b.real >= 0` to safely
  support complex coefficients.
- Update `quadratic_solve` return type hint to `np.ndarray`.
This commit is contained in:
2026-09-26 11:41:11 -04:00
parent 299f354b59
commit 563fb440a3
3 changed files with 67 additions and 91 deletions
+6 -8
View File
@@ -5,14 +5,14 @@ build-backend = "setuptools.build_meta"
[project]
# --- Core Metadata ---
name = "polysolve"
version = "0.7.1"
version = "0.8.0"
authors = [
{ name="Jonathan Rampersad", email="[email protected]" },
]
description = "A Python library for representing, manipulating, and solving exponential functions using analytical methods and genetic algorithms, with optional CUDA acceleration."
readme = "README.md"
requires-python = ">=3.8"
license = { file="LICENSE" }
requires-python = ">=3.10"
license = { file = "LICENSE" }
keywords = ["math", "polynomial", "genetic algorithm", "cuda", "equation solver"]
# --- Classifiers ---
@@ -23,8 +23,6 @@ classifiers = [
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
@@ -35,8 +33,8 @@ classifiers = [
# --- Dependencies ---
dependencies = [
"numpy>=1.21",
"numba"
"numpy>=2.0",
"numba>=0.60"
]
# --- Optional Dependencies (Extras) ---
@@ -47,5 +45,5 @@ dev = ["pytest"]
[project.urls]
Homepage = "https://polysolve.jono-rams.work"
Documentation = "https://polysolve.jono-rams.work/docs"
Repository = "https://github.com/jono-rams/PolySolve"
Repository = "https://github.com/jono-rams/PolySolve"
"Bug Tracker" = "https://github.com/jono-rams/PolySolve/issues"