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.
Files changed (27) hide show
  1. {mathjson_solver-1.16.0/src/mathjson_solver.egg-info → mathjson_solver-1.16.1}/PKG-INFO +1 -1
  2. {mathjson_solver-1.16.0 → mathjson_solver-1.16.1}/setup.cfg +1 -1
  3. {mathjson_solver-1.16.0 → mathjson_solver-1.16.1}/setup.py +1 -1
  4. {mathjson_solver-1.16.0 → mathjson_solver-1.16.1}/src/mathjson_solver/__main__.py +5 -12
  5. {mathjson_solver-1.16.0 → mathjson_solver-1.16.1/src/mathjson_solver.egg-info}/PKG-INFO +1 -1
  6. {mathjson_solver-1.16.0 → mathjson_solver-1.16.1}/LICENSE +0 -0
  7. {mathjson_solver-1.16.0 → mathjson_solver-1.16.1}/README.md +0 -0
  8. {mathjson_solver-1.16.0 → mathjson_solver-1.16.1}/pyproject.toml +0 -0
  9. {mathjson_solver-1.16.0 → mathjson_solver-1.16.1}/src/mathjson_solver/__init__.py +0 -0
  10. {mathjson_solver-1.16.0 → mathjson_solver-1.16.1}/src/mathjson_solver.egg-info/SOURCES.txt +0 -0
  11. {mathjson_solver-1.16.0 → mathjson_solver-1.16.1}/src/mathjson_solver.egg-info/dependency_links.txt +0 -0
  12. {mathjson_solver-1.16.0 → mathjson_solver-1.16.1}/src/mathjson_solver.egg-info/top_level.txt +0 -0
  13. {mathjson_solver-1.16.0 → mathjson_solver-1.16.1}/tests/test_CumulativeProduct.py +0 -0
  14. {mathjson_solver-1.16.0 → mathjson_solver-1.16.1}/tests/test_Slice.py +0 -0
  15. {mathjson_solver-1.16.0 → mathjson_solver-1.16.1}/tests/test_TrapezoidalIntegratel.py +0 -0
  16. {mathjson_solver-1.16.0 → mathjson_solver-1.16.1}/tests/test_atindex.py +0 -0
  17. {mathjson_solver-1.16.0 → mathjson_solver-1.16.1}/tests/test_equal.py +0 -0
  18. {mathjson_solver-1.16.0 → mathjson_solver-1.16.1}/tests/test_exceptions.py +0 -0
  19. {mathjson_solver-1.16.0 → mathjson_solver-1.16.1}/tests/test_extract_variables.py +0 -0
  20. {mathjson_solver-1.16.0 → mathjson_solver-1.16.1}/tests/test_findinterval.py +0 -0
  21. {mathjson_solver-1.16.0 → mathjson_solver-1.16.1}/tests/test_gail_model.py +0 -0
  22. {mathjson_solver-1.16.0 → mathjson_solver-1.16.1}/tests/test_interpolate.py +0 -0
  23. {mathjson_solver-1.16.0 → mathjson_solver-1.16.1}/tests/test_range.py +0 -0
  24. {mathjson_solver-1.16.0 → mathjson_solver-1.16.1}/tests/test_scalars.py +0 -0
  25. {mathjson_solver-1.16.0 → mathjson_solver-1.16.1}/tests/test_sets.py +0 -0
  26. {mathjson_solver-1.16.0 → mathjson_solver-1.16.1}/tests/test_simple_cases.py +0 -0
  27. {mathjson_solver-1.16.0 → mathjson_solver-1.16.1}/tests/test_with_pytest.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mathjson-solver
3
- Version: 1.16.0
3
+ Version: 1.16.1
4
4
  Summary: Utilities for MathJSON evaluation
5
5
  Home-page: https://github.com/LongenesisLtd/mathjson-solver
6
6
  Author: Martins Mednis
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = mathjson-solver
3
- version = 1.16.0
3
+ version = 1.16.1
4
4
  author = Martins Mednis
5
5
  author_email = mrt@mednis.info
6
6
  description = Utilities for MathJSON evaluation
@@ -5,7 +5,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
5
5
 
6
6
  setuptools.setup(
7
7
  name="mathjson-solver",
8
- version="1.16.0",
8
+ version="1.16.1",
9
9
  author="Martins Mednis",
10
10
  author_email="mrt@mednis.info",
11
11
  description="Utilities for MathJSON evaluation",
@@ -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
- logging.error(
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
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mathjson-solver
3
- Version: 1.16.0
3
+ Version: 1.16.1
4
4
  Summary: Utilities for MathJSON evaluation
5
5
  Home-page: https://github.com/LongenesisLtd/mathjson-solver
6
6
  Author: Martins Mednis