MCPcopy Create free account
hub / github.com/PRIME-RL/PRIME / _sympy_parse

Function _sympy_parse

data_preprocessing/math_util/__init__.py:24–33  ·  view source on GitHub ↗

Parses an expression with sympy.

(expr: str)

Source from the content-addressed store, hash-verified

22
23
24def _sympy_parse(expr: str):
25 """Parses an expression with sympy."""
26 py_expr = expr.replace("^", "**")
27 return sympy_parser.parse_expr(
28 py_expr,
29 transformations=(
30 sympy_parser.standard_transformations
31 + (sympy_parser.implicit_multiplication_application,)
32 ),
33 )
34
35
36def _parse_latex(expr: str) -> str:

Callers 1

are_equal_under_sympyFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected