33import os
44import time
55import json
6- from typing import Dict , List , Union , Optional
6+ from typing import Dict , List , Optional , Union
77
88from .base_client import BaseClient , AsyncBaseClient
9- from . import ParseResponse , EquationProcessingResponse , EquationExtractionResponse
9+ from . import ParseResponse , EquationExtractionResponse , EquationProcessingResponse
10+ from .axtract .axtract_report import create_report
11+ from .axtract .validation_results import display_full_results
12+ from .axtract .interactive_table import _create_variable_dict
13+ from .types .variable_requirement import VariableRequirement as ApiVariableRequirement
14+
1015
1116class Axiomatic (BaseClient ):
1217 def __init__ (self , * args , ** kwargs ):
@@ -28,8 +33,6 @@ def __init__(self, ax_client: Axiomatic):
2833 self ._ax_client = ax_client
2934
3035 def create_report (self , response : EquationExtractionResponse , path : str ):
31- from .axtract .axtract_report import create_report
32-
3336 create_report (response , path )
3437
3538 def analyze_equations (
@@ -38,6 +41,8 @@ def analyze_equations(
3841 url_path : Optional [str ] = None ,
3942 parsed_paper : Optional [ParseResponse ] = None ,
4043 ) -> Optional [EquationExtractionResponse ]:
44+ response : Union [EquationExtractionResponse , EquationProcessingResponse ]
45+
4146 if file_path :
4247 with open (file_path , "rb" ) as file :
4348 response = self ._ax_client .document .equation .from_pdf (document = file )
@@ -60,10 +65,6 @@ def validate_equations(
6065 loaded_equations : EquationExtractionResponse ,
6166 show_hypergraph : bool = True ,
6267 ):
63- from .axtract .validation_results import display_full_results
64- from .axtract .interactive_table import _create_variable_dict
65- from .types .variable_requirement import VariableRequirement as ApiVariableRequirement
66-
6768 api_requirements = [
6869 ApiVariableRequirement (
6970 symbol = req .symbol , name = req .name , value = req .value , units = req .units , tolerance = req .tolerance
0 commit comments