rgwfuncs 0.0.49__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.
- {rgwfuncs-0.0.49/src/rgwfuncs.egg-info → rgwfuncs-0.0.50}/PKG-INFO +1 -1
- {rgwfuncs-0.0.49 → rgwfuncs-0.0.50}/pyproject.toml +1 -1
- {rgwfuncs-0.0.49 → rgwfuncs-0.0.50}/setup.cfg +1 -1
- {rgwfuncs-0.0.49 → rgwfuncs-0.0.50}/src/rgwfuncs/algebra_lib.py +13 -7
- {rgwfuncs-0.0.49 → rgwfuncs-0.0.50/src/rgwfuncs.egg-info}/PKG-INFO +1 -1
- {rgwfuncs-0.0.49 → rgwfuncs-0.0.50}/LICENSE +0 -0
- {rgwfuncs-0.0.49 → rgwfuncs-0.0.50}/README.md +0 -0
- {rgwfuncs-0.0.49 → rgwfuncs-0.0.50}/src/rgwfuncs/__init__.py +0 -0
- {rgwfuncs-0.0.49 → rgwfuncs-0.0.50}/src/rgwfuncs/df_lib.py +0 -0
- {rgwfuncs-0.0.49 → rgwfuncs-0.0.50}/src/rgwfuncs/docs_lib.py +0 -0
- {rgwfuncs-0.0.49 → rgwfuncs-0.0.50}/src/rgwfuncs/interactive_shell_lib.py +0 -0
- {rgwfuncs-0.0.49 → rgwfuncs-0.0.50}/src/rgwfuncs/str_lib.py +0 -0
- {rgwfuncs-0.0.49 → rgwfuncs-0.0.50}/src/rgwfuncs.egg-info/SOURCES.txt +0 -0
- {rgwfuncs-0.0.49 → rgwfuncs-0.0.50}/src/rgwfuncs.egg-info/dependency_links.txt +0 -0
- {rgwfuncs-0.0.49 → rgwfuncs-0.0.50}/src/rgwfuncs.egg-info/entry_points.txt +0 -0
- {rgwfuncs-0.0.49 → rgwfuncs-0.0.50}/src/rgwfuncs.egg-info/requires.txt +0 -0
- {rgwfuncs-0.0.49 → rgwfuncs-0.0.50}/src/rgwfuncs.egg-info/top_level.txt +0 -0
@@ -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,21 +676,28 @@ def solve_homogeneous_polynomial_expression(
|
|
677
676
|
"""
|
678
677
|
|
679
678
|
try:
|
679
|
+
# Handle symbols
|
680
680
|
variable_symbols = set(re.findall(r'\b[a-zA-Z]\w*\b', expression))
|
681
681
|
sym_vars = {var: symbols(var) for var in variable_symbols}
|
682
|
+
|
683
|
+
# Parse the expression
|
682
684
|
expr = parse_expr(expression, local_dict=sym_vars)
|
685
|
+
|
686
|
+
# Apply substitutions
|
683
687
|
if subs:
|
684
688
|
expr = expr.subs({symbols(k): v for k, v in subs.items()})
|
689
|
+
|
690
|
+
# Solve the equation
|
685
691
|
var_symbol = symbols(variable)
|
686
692
|
eq = Eq(expr, 0)
|
687
693
|
solutions = solve(eq, var_symbol)
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
694
|
+
|
695
|
+
# Convert solutions to LaTeX strings with handling for exact representations
|
696
|
+
latex_solutions = [latex(sol) for sol in solutions]
|
697
|
+
|
698
|
+
result = r"\left[" + ", ".join(latex_solutions) + r"\right]"
|
699
|
+
print("693", result)
|
693
700
|
return result
|
694
701
|
|
695
702
|
except Exception as e:
|
696
703
|
raise ValueError(f"Error solving the expression: {e}")
|
697
|
-
|
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
|