rgwfuncs 0.0.47__py3-none-any.whl → 0.0.49__py3-none-any.whl
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/algebra_lib.py +5 -18
- {rgwfuncs-0.0.47.dist-info → rgwfuncs-0.0.49.dist-info}/METADATA +1 -1
- {rgwfuncs-0.0.47.dist-info → rgwfuncs-0.0.49.dist-info}/RECORD +7 -7
- {rgwfuncs-0.0.47.dist-info → rgwfuncs-0.0.49.dist-info}/LICENSE +0 -0
- {rgwfuncs-0.0.47.dist-info → rgwfuncs-0.0.49.dist-info}/WHEEL +0 -0
- {rgwfuncs-0.0.47.dist-info → rgwfuncs-0.0.49.dist-info}/entry_points.txt +0 -0
- {rgwfuncs-0.0.47.dist-info → rgwfuncs-0.0.49.dist-info}/top_level.txt +0 -0
rgwfuncs/algebra_lib.py
CHANGED
@@ -676,33 +676,20 @@ def solve_homogeneous_polynomial_expression(
|
|
676
676
|
ValueError: If the equation cannot be solved due to errors in expression or parameters.
|
677
677
|
"""
|
678
678
|
|
679
|
-
print("679", expression)
|
680
|
-
print("681", variable)
|
681
|
-
print("682", subs)
|
682
679
|
try:
|
683
|
-
# Create symbols for the variables in the expression
|
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
|
-
|
687
|
-
# Parse the expression
|
688
682
|
expr = parse_expr(expression, local_dict=sym_vars)
|
689
|
-
|
690
|
-
# If substitutions are provided, apply them
|
691
683
|
if subs:
|
692
684
|
expr = expr.subs({symbols(k): v for k, v in subs.items()})
|
693
|
-
|
694
|
-
# Ensure the variable is treated as a symbol for solving
|
695
685
|
var_symbol = symbols(variable)
|
696
|
-
|
697
|
-
# Solve for the variable
|
698
686
|
eq = Eq(expr, 0)
|
699
687
|
solutions = solve(eq, var_symbol)
|
700
|
-
|
701
|
-
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
print("704", result)
|
688
|
+
if solutions:
|
689
|
+
latex_solutions = [latex(simplify(sol)) for sol in solutions]
|
690
|
+
result = r"\left[" + ", ".join(latex_solutions) + r"\right]"
|
691
|
+
else:
|
692
|
+
result = r"\left[\text{No solutions found}\right]"
|
706
693
|
return result
|
707
694
|
|
708
695
|
except Exception as e:
|
@@ -1,12 +1,12 @@
|
|
1
1
|
rgwfuncs/__init__.py,sha256=vs8xv3IVx7KGpPxEXrIePD3gb_QI1XTXpD_n9817foA,1610
|
2
|
-
rgwfuncs/algebra_lib.py,sha256=
|
2
|
+
rgwfuncs/algebra_lib.py,sha256=PkuSVFjh6_Nj_gmbJha7cVn5b9YQ-vdh-NuYrMMyObE,28117
|
3
3
|
rgwfuncs/df_lib.py,sha256=qqRQdakheLy8wMZRBfHwKyIp8DmdZIWfAiLKWgq03QU,68977
|
4
4
|
rgwfuncs/docs_lib.py,sha256=y3wSAOPO3qsA4HZ7xAtW8HimM8w-c8hjcEzMRLJ96ao,1960
|
5
5
|
rgwfuncs/interactive_shell_lib.py,sha256=A7EWsYxAfDev_N0-2GjRvAtp0bAwBPHIczXb8Gu9fzI,1107
|
6
6
|
rgwfuncs/str_lib.py,sha256=rtAdRlnSJIu3JhI-tA_A0wCiPK2m-zn5RoGpBxv_g-4,2228
|
7
|
-
rgwfuncs-0.0.
|
8
|
-
rgwfuncs-0.0.
|
9
|
-
rgwfuncs-0.0.
|
10
|
-
rgwfuncs-0.0.
|
11
|
-
rgwfuncs-0.0.
|
12
|
-
rgwfuncs-0.0.
|
7
|
+
rgwfuncs-0.0.49.dist-info/LICENSE,sha256=7EI8xVBu6h_7_JlVw-yPhhOZlpY9hP8wal7kHtqKT_E,1074
|
8
|
+
rgwfuncs-0.0.49.dist-info/METADATA,sha256=otThG48mMKENJO6Hv3XJa42Ix1ImWCIhEBtdyfNX3Qk,55152
|
9
|
+
rgwfuncs-0.0.49.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
|
10
|
+
rgwfuncs-0.0.49.dist-info/entry_points.txt,sha256=j-c5IOPIQ0252EaOV6j6STio56sbXl2C4ym_fQ0lXx0,43
|
11
|
+
rgwfuncs-0.0.49.dist-info/top_level.txt,sha256=aGuVIzWsKiV1f2gCb6mynx0zx5ma0B1EwPGFKVEMTi4,9
|
12
|
+
rgwfuncs-0.0.49.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|