3
3
import os
4
4
import time
5
5
import json
6
- from typing import Dict , List , Union , Optional
6
+ from typing import Dict , List , Optional , Union
7
7
8
8
from .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
+
10
15
11
16
class Axiomatic (BaseClient ):
12
17
def __init__ (self , * args , ** kwargs ):
@@ -28,8 +33,6 @@ def __init__(self, ax_client: Axiomatic):
28
33
self ._ax_client = ax_client
29
34
30
35
def create_report (self , response : EquationExtractionResponse , path : str ):
31
- from .axtract .axtract_report import create_report
32
-
33
36
create_report (response , path )
34
37
35
38
def analyze_equations (
@@ -38,6 +41,8 @@ def analyze_equations(
38
41
url_path : Optional [str ] = None ,
39
42
parsed_paper : Optional [ParseResponse ] = None ,
40
43
) -> Optional [EquationExtractionResponse ]:
44
+ response : Union [EquationExtractionResponse , EquationProcessingResponse ]
45
+
41
46
if file_path :
42
47
with open (file_path , "rb" ) as file :
43
48
response = self ._ax_client .document .equation .from_pdf (document = file )
@@ -60,10 +65,6 @@ def validate_equations(
60
65
loaded_equations : EquationExtractionResponse ,
61
66
show_hypergraph : bool = True ,
62
67
):
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
-
67
68
api_requirements = [
68
69
ApiVariableRequirement (
69
70
symbol = req .symbol , name = req .name , value = req .value , units = req .units , tolerance = req .tolerance
0 commit comments