Skip to content

Commit fac5ca2

Browse files
committed
errors fixed
1 parent b6a2a6b commit fac5ca2

File tree

3 files changed

+11
-19
lines changed

3 files changed

+11
-19
lines changed

src/axiomatic/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
requirements,
9595
tools,
9696
)
97-
from .client import AsyncAxiomatic, Axiomatic, AxtractHelper
97+
from .client import AsyncAxiomatic, Axiomatic
9898
from .environment import AxiomaticEnvironment
9999
from .version import __version__
100100

@@ -103,7 +103,6 @@
103103
"AxesInfo",
104104
"Axiomatic",
105105
"AxiomaticEnvironment",
106-
"AxtractHelper",
107106
"Bundle",
108107
"BundleSettingsValue",
109108
"Computation",

src/axiomatic/axtract/interactive_table.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ def save_custom_presets(custom_data, file_path):
151151
# 5) For the "Add Requirement" dropdown
152152
# ---------------------------------------------------------------
153153
variable_names = [details["name"] for details in variable_dict.values()]
154-
154+
print(variable_names)
155155
# This dict will store the final user inputs after pressing "Submit"
156156
result = {}
157157

src/axiomatic/client.py

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import requests
33
import os
44
import time
5-
from typing import Dict, List, Union, Optional
5+
from typing import Dict, List, Optional
66

77
from .base_client import BaseClient, AsyncBaseClient
88
from . import ParseResponse
@@ -17,6 +17,7 @@ def __init__(self, *args, **kwargs):
1717

1818
self.document_helper = DocumentHelper(self)
1919
self.tools_helper = ToolsHelper(self)
20+
self.axtract_helper = AxtractHelper(self)
2021

2122

2223
class AxtractHelper:
@@ -32,26 +33,21 @@ def create_report(self, response: EquationExtractionResponse, path: str):
3233

3334
create_report(response, path)
3435

35-
def analyze_equations(
36-
self,
37-
file_path: Optional[str] = None,
38-
url_path: Optional[str] = None
39-
) -> Optional[EquationExtractionResponse]:
36+
def analyze_equations(self, file_path: Optional[str] = None, url_path: Optional[str] = None):
4037
if file_path:
4138
with open(file_path, "rb") as file:
4239
response = self._ax_client.document.equation.from_pdf(document=file)
4340

4441
elif url_path:
4542
if "arxiv" in url_path and "abs" in url_path:
4643
url_path = url_path.replace("abs", "pdf")
47-
48-
response = self._ax_client.document.equation.from_pdf(document=url_path)
44+
file = requests.get(url_path)
45+
response = self._ax_client.document.equation.from_pdf(document=file.content)
4946

5047
else:
5148
print("Please provide either a file path or a URL to analyze.")
5249
return None
53-
54-
return EquationExtractionResponse(equations=response.equations)
50+
return response
5551

5652
def validate_equations(
5753
self,
@@ -65,12 +61,9 @@ def validate_equations(
6561

6662
api_requirements = [
6763
ApiVariableRequirement(
68-
symbol=req.symbol,
69-
name=req.name,
70-
value=req.value,
71-
units=req.units,
72-
tolerance=req.tolerance
73-
) for req in requirements
64+
symbol=req.symbol, name=req.name, value=req.value, units=req.units, tolerance=req.tolerance
65+
)
66+
for req in requirements
7467
]
7568

7669
variable_dict = _create_variable_dict(loaded_equations)

0 commit comments

Comments
 (0)