Skip to content

Commit b020698

Browse files
authored
Merge pull request #24 from Axiomatic-AI/kevin_small_changes
Kevin small changes
2 parents d7f1413 + d3a04a6 commit b020698

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

src/axiomatic/axtract.py

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ def get_numerical_values(ax_client, path, constants_of_interest):
615615
file = f.read()
616616

617617
constants = ax_client.document.constants(file=file, constants=constants_of_interest).constants
618-
618+
print(constants)
619619
# Create a dictionary to store processed values
620620
processed_values = {}
621621

@@ -636,14 +636,35 @@ def get_numerical_values(ax_client, path, constants_of_interest):
636636
"Value": f_number,
637637
"Units": "dimensionless"
638638
}
639+
elif 'f/' in value_str:
640+
# Handle F-number values
641+
f_number = float(value_str.split('/')[-1])
642+
processed_values[constant_name] = {
643+
"Value": f_number,
644+
"Units": "dimensionless"
645+
}
639646
else:
640647
# Handle normal values with units
641648
# Split on the last space to separate value and unit
642649
parts = value_str.rsplit(' ', 1)
643650
if len(parts) == 2:
644651
value, unit = parts
652+
# Convert value to float
653+
value = float(value)
654+
655+
# Handle unit conversions to meters
656+
if unit == "\u00b5m": # micrometer
657+
value *= 1e-6
658+
unit = "m"
659+
elif unit == "mm": # millimeter
660+
value *= 1e-3
661+
unit = "m"
662+
elif unit == "km": # kilometer
663+
value *= 1e3
664+
unit = "m"
665+
645666
processed_values[constant_name] = {
646-
"Value": float(value),
667+
"Value": value,
647668
"Units": unit
648669
}
649670
else:

0 commit comments

Comments
 (0)