polysolve 0.4.0__tar.gz → 0.4.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {polysolve-0.4.0/src/polysolve.egg-info → polysolve-0.4.1}/PKG-INFO +1 -1
- {polysolve-0.4.0 → polysolve-0.4.1}/pyproject.toml +1 -1
- {polysolve-0.4.0 → polysolve-0.4.1}/src/polysolve/__init__.py +4 -2
- {polysolve-0.4.0 → polysolve-0.4.1/src/polysolve.egg-info}/PKG-INFO +1 -1
- {polysolve-0.4.0 → polysolve-0.4.1}/LICENSE +0 -0
- {polysolve-0.4.0 → polysolve-0.4.1}/README.md +0 -0
- {polysolve-0.4.0 → polysolve-0.4.1}/setup.cfg +0 -0
- {polysolve-0.4.0 → polysolve-0.4.1}/src/polysolve.egg-info/SOURCES.txt +0 -0
- {polysolve-0.4.0 → polysolve-0.4.1}/src/polysolve.egg-info/dependency_links.txt +0 -0
- {polysolve-0.4.0 → polysolve-0.4.1}/src/polysolve.egg-info/requires.txt +0 -0
- {polysolve-0.4.0 → polysolve-0.4.1}/src/polysolve.egg-info/top_level.txt +0 -0
- {polysolve-0.4.0 → polysolve-0.4.1}/tests/test_polysolve.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: polysolve
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.1
|
|
4
4
|
Summary: A Python library for representing, manipulating, and solving exponential functions using analytical methods and genetic algorithms, with optional CUDA acceleration.
|
|
5
5
|
Author-email: Jonathan Rampersad <jonathan@jono-rams.work>
|
|
6
6
|
License: MIT License
|
|
@@ -295,7 +295,8 @@ class Function:
|
|
|
295
295
|
y_calculated = np.polyval(self.coefficients, solutions)
|
|
296
296
|
error = y_calculated - y_val
|
|
297
297
|
|
|
298
|
-
|
|
298
|
+
with np.errstate(divide='ignore'):
|
|
299
|
+
ranks = np.where(error == 0, np.finfo(float).max, np.abs(1.0 / error))
|
|
299
300
|
|
|
300
301
|
# Sort solutions by fitness (descending)
|
|
301
302
|
sorted_indices = np.argsort(-ranks)
|
|
@@ -345,7 +346,8 @@ class Function:
|
|
|
345
346
|
# After all generations, do one last ranking to find the best solutions
|
|
346
347
|
y_calculated = np.polyval(self.coefficients, solutions)
|
|
347
348
|
error = y_calculated - y_val
|
|
348
|
-
|
|
349
|
+
with np.errstate(divide='ignore'):
|
|
350
|
+
ranks = np.where(error == 0, np.finfo(float).max, np.abs(1.0 / error))
|
|
349
351
|
sorted_indices = np.argsort(-ranks)
|
|
350
352
|
|
|
351
353
|
# Get the top 'sample_size' solutions the user asked for
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: polysolve
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.1
|
|
4
4
|
Summary: A Python library for representing, manipulating, and solving exponential functions using analytical methods and genetic algorithms, with optional CUDA acceleration.
|
|
5
5
|
Author-email: Jonathan Rampersad <jonathan@jono-rams.work>
|
|
6
6
|
License: MIT License
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|