mathjson-solver 1.16.0__tar.gz → 1.16.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.
- {mathjson_solver-1.16.0/src/mathjson_solver.egg-info → mathjson_solver-1.16.1}/PKG-INFO +1 -1
- {mathjson_solver-1.16.0 → mathjson_solver-1.16.1}/setup.cfg +1 -1
- {mathjson_solver-1.16.0 → mathjson_solver-1.16.1}/setup.py +1 -1
- {mathjson_solver-1.16.0 → mathjson_solver-1.16.1}/src/mathjson_solver/__main__.py +5 -12
- {mathjson_solver-1.16.0 → mathjson_solver-1.16.1/src/mathjson_solver.egg-info}/PKG-INFO +1 -1
- {mathjson_solver-1.16.0 → mathjson_solver-1.16.1}/LICENSE +0 -0
- {mathjson_solver-1.16.0 → mathjson_solver-1.16.1}/README.md +0 -0
- {mathjson_solver-1.16.0 → mathjson_solver-1.16.1}/pyproject.toml +0 -0
- {mathjson_solver-1.16.0 → mathjson_solver-1.16.1}/src/mathjson_solver/__init__.py +0 -0
- {mathjson_solver-1.16.0 → mathjson_solver-1.16.1}/src/mathjson_solver.egg-info/SOURCES.txt +0 -0
- {mathjson_solver-1.16.0 → mathjson_solver-1.16.1}/src/mathjson_solver.egg-info/dependency_links.txt +0 -0
- {mathjson_solver-1.16.0 → mathjson_solver-1.16.1}/src/mathjson_solver.egg-info/top_level.txt +0 -0
- {mathjson_solver-1.16.0 → mathjson_solver-1.16.1}/tests/test_CumulativeProduct.py +0 -0
- {mathjson_solver-1.16.0 → mathjson_solver-1.16.1}/tests/test_Slice.py +0 -0
- {mathjson_solver-1.16.0 → mathjson_solver-1.16.1}/tests/test_TrapezoidalIntegratel.py +0 -0
- {mathjson_solver-1.16.0 → mathjson_solver-1.16.1}/tests/test_atindex.py +0 -0
- {mathjson_solver-1.16.0 → mathjson_solver-1.16.1}/tests/test_equal.py +0 -0
- {mathjson_solver-1.16.0 → mathjson_solver-1.16.1}/tests/test_exceptions.py +0 -0
- {mathjson_solver-1.16.0 → mathjson_solver-1.16.1}/tests/test_extract_variables.py +0 -0
- {mathjson_solver-1.16.0 → mathjson_solver-1.16.1}/tests/test_findinterval.py +0 -0
- {mathjson_solver-1.16.0 → mathjson_solver-1.16.1}/tests/test_gail_model.py +0 -0
- {mathjson_solver-1.16.0 → mathjson_solver-1.16.1}/tests/test_interpolate.py +0 -0
- {mathjson_solver-1.16.0 → mathjson_solver-1.16.1}/tests/test_range.py +0 -0
- {mathjson_solver-1.16.0 → mathjson_solver-1.16.1}/tests/test_scalars.py +0 -0
- {mathjson_solver-1.16.0 → mathjson_solver-1.16.1}/tests/test_sets.py +0 -0
- {mathjson_solver-1.16.0 → mathjson_solver-1.16.1}/tests/test_simple_cases.py +0 -0
- {mathjson_solver-1.16.0 → mathjson_solver-1.16.1}/tests/test_with_pytest.py +0 -0
|
@@ -4,8 +4,6 @@ from functools import reduce
|
|
|
4
4
|
import math
|
|
5
5
|
from copy import deepcopy
|
|
6
6
|
from statistics import median
|
|
7
|
-
import logging
|
|
8
|
-
import traceback
|
|
9
7
|
import datetime
|
|
10
8
|
|
|
11
9
|
NUMPY_AVAILABLE = False
|
|
@@ -344,7 +342,6 @@ def create_mathjson_solver(solver_parameters):
|
|
|
344
342
|
s_ = [float(f(x, c)) for x in f(s[1], c) if is_numeric(f(x, c))]
|
|
345
343
|
else:
|
|
346
344
|
s_ = [float(f(x, c)) for x in s[1][1:] if is_numeric(f(x, c))]
|
|
347
|
-
# print(f"{s_} {sum(s_)}/{len(s_)}")
|
|
348
345
|
try:
|
|
349
346
|
return sum(s_) / len(s_)
|
|
350
347
|
except ZeroDivisionError:
|
|
@@ -419,12 +416,9 @@ def create_mathjson_solver(solver_parameters):
|
|
|
419
416
|
try:
|
|
420
417
|
return f(x[1], c)
|
|
421
418
|
except MathJSONException:
|
|
422
|
-
|
|
423
|
-
"MathJSONException: %s", traceback.format_exc()
|
|
424
|
-
)
|
|
419
|
+
# Branch failed, try next condition
|
|
425
420
|
continue
|
|
426
421
|
except MathJSONException:
|
|
427
|
-
logging.error("MathJSONException: %s", traceback.format_exc())
|
|
428
422
|
return f(s[-1], c) # return default value (else)
|
|
429
423
|
|
|
430
424
|
return f(s[-1], c)
|
|
@@ -902,7 +896,6 @@ def create_mathjson_solver(solver_parameters):
|
|
|
902
896
|
c[variable_name] = variable_value
|
|
903
897
|
values.append(f(function_expression, c))
|
|
904
898
|
h = (end - start) / n
|
|
905
|
-
# print("values=", values)
|
|
906
899
|
return h * (0.5 * values[0] + np.sum(values[1:-1]) + 0.5 * values[-1])
|
|
907
900
|
|
|
908
901
|
# return total_area
|
|
@@ -1021,13 +1014,13 @@ def create_mathjson_solver(solver_parameters):
|
|
|
1021
1014
|
# return s[0]
|
|
1022
1015
|
# except Exception as e:
|
|
1023
1016
|
except TypeError as e:
|
|
1024
|
-
raise MathJSONException(e, s, mathjson_construct=s[0])
|
|
1017
|
+
raise MathJSONException(e, s, mathjson_construct=s[0]) from e
|
|
1025
1018
|
except ValueError as e:
|
|
1026
|
-
raise MathJSONException(e, s, mathjson_construct=s[0])
|
|
1019
|
+
raise MathJSONException(e, s, mathjson_construct=s[0]) from e
|
|
1027
1020
|
except IndexError as e:
|
|
1028
|
-
raise MathJSONException(e, s, mathjson_construct=s[0])
|
|
1021
|
+
raise MathJSONException(e, s, mathjson_construct=s[0]) from e
|
|
1029
1022
|
except ZeroDivisionError as e:
|
|
1030
|
-
raise MathJSONException(e, s, mathjson_construct=s[0])
|
|
1023
|
+
raise MathJSONException(e, s, mathjson_construct=s[0]) from e
|
|
1031
1024
|
else:
|
|
1032
1025
|
# raise MathJSONException(
|
|
1033
1026
|
# NotImplementedError(f"'{s[0]}' is not supported"), s
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{mathjson_solver-1.16.0 → mathjson_solver-1.16.1}/src/mathjson_solver.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{mathjson_solver-1.16.0 → mathjson_solver-1.16.1}/src/mathjson_solver.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|