rgwfuncs 0.0.48__tar.gz → 0.0.50__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: rgwfuncs
3
- Version: 0.0.48
3
+ Version: 0.0.50
4
4
  Summary: A functional programming paradigm for mathematical modelling and data science
5
5
  Home-page: https://github.com/ryangerardwilson/rgwfunc
6
6
  Author: Ryan Gerard Wilson
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "rgwfuncs"
7
- version = "0.0.48"
7
+ version = "0.0.50"
8
8
  authors = [
9
9
  { name = "Ryan Gerard Wilson", email = "ryangerardwilson@gmail.com" },
10
10
  ]
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = rgwfuncs
3
- version = 0.0.48
3
+ version = 0.0.50
4
4
  author = Ryan Gerard Wilson
5
5
  author_email = ryangerardwilson@gmail.com
6
6
  description = A functional programming paradigm for mathematical modelling and data science
@@ -1,7 +1,6 @@
1
1
  import re
2
2
  import math
3
3
  import ast
4
- # import numpy as np
5
4
  from sympy import symbols, latex, simplify, solve, diff, Expr, factor, cancel, Eq
6
5
  from sympy.core.sympify import SympifyError
7
6
  from sympy.core import S
@@ -677,36 +676,28 @@ def solve_homogeneous_polynomial_expression(
677
676
  """
678
677
 
679
678
  try:
680
- print("679", expression)
681
- print("681", variable)
682
- print("682", subs)
683
-
679
+ # Handle symbols
684
680
  variable_symbols = set(re.findall(r'\b[a-zA-Z]\w*\b', expression))
685
681
  sym_vars = {var: symbols(var) for var in variable_symbols}
686
682
 
683
+ # Parse the expression
687
684
  expr = parse_expr(expression, local_dict=sym_vars)
688
- print("Parsed expression:", expr)
689
685
 
686
+ # Apply substitutions
690
687
  if subs:
691
688
  expr = expr.subs({symbols(k): v for k, v in subs.items()})
692
- print("Expression after substitution:", expr)
693
689
 
690
+ # Solve the equation
694
691
  var_symbol = symbols(variable)
695
-
696
692
  eq = Eq(expr, 0)
697
- print("Equation to solve:", eq)
698
-
699
693
  solutions = solve(eq, var_symbol)
700
694
 
701
- if solutions:
702
- latex_solutions = [latex(simplify(sol)) for sol in solutions]
703
- result = r"\left[" + ", ".join(latex_solutions) + r"\right]"
704
- else:
705
- result = r"\left[\right]"
695
+ # Convert solutions to LaTeX strings with handling for exact representations
696
+ latex_solutions = [latex(sol) for sol in solutions]
706
697
 
707
- print("704", result)
698
+ result = r"\left[" + ", ".join(latex_solutions) + r"\right]"
699
+ print("693", result)
708
700
  return result
709
701
 
710
702
  except Exception as e:
711
703
  raise ValueError(f"Error solving the expression: {e}")
712
-
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: rgwfuncs
3
- Version: 0.0.48
3
+ Version: 0.0.50
4
4
  Summary: A functional programming paradigm for mathematical modelling and data science
5
5
  Home-page: https://github.com/ryangerardwilson/rgwfunc
6
6
  Author: Ryan Gerard Wilson
File without changes
File without changes