mirror of
https://github.com/NousResearch/atropos.git
synced 2026-04-22 16:48:57 +00:00
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
This commit is contained in:
parent
830a129655
commit
52110f3fb4
2 changed files with 45 additions and 22 deletions
|
|
@ -691,7 +691,9 @@ def master_convert(s: str):
|
|||
Various exceptions if conversion fails
|
||||
"""
|
||||
if not EED_AVAILABLE:
|
||||
raise ImportError("latex2sympy2_extended and sympy are required for EED scoring")
|
||||
raise ImportError(
|
||||
"latex2sympy2_extended and sympy are required for EED scoring"
|
||||
)
|
||||
|
||||
preprocessed_stage1 = first_preprocess(s)
|
||||
preprocessed_stage2 = second_preprocess(preprocessed_stage1)
|
||||
|
|
@ -723,7 +725,9 @@ def sympy_to_tree(expr) -> TreeNode:
|
|||
ValueError: If expression contains unsupported types
|
||||
"""
|
||||
# Numbers and constants
|
||||
if isinstance(expr, (Integer, Pi, Exp1, Float, Rational, Infinity, NegativeInfinity)):
|
||||
if isinstance(
|
||||
expr, (Integer, Pi, Exp1, Float, Rational, Infinity, NegativeInfinity)
|
||||
):
|
||||
return TreeNode(label=f"number_{expr}", children=[])
|
||||
|
||||
# Symbols
|
||||
|
|
@ -967,4 +971,3 @@ def extract_all_boxed(latex_str: str) -> List[str]:
|
|||
"""
|
||||
pattern = r"\\boxed\{([^{}]*(?:\{[^{}]*\}[^{}]*)*)\}"
|
||||
return re.findall(pattern, latex_str)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue