UnitParser
init
_load_sympy_units
_add_si_prefixes
parse_unit
- unit_str (str): The unit string to parse.
parse_unit_with_latex
- unit_str (str): The unit string in LaTeX format.
detect_scaling_factor
- unit_expr (Any): The unit expression.
preprocess_unit_string
- unit_str (str): The unit string to preprocess.
unit_is_none
- unit_str (Optional[str]): The unit string to check.
extract_value_and_unit
- expr (Any): SymPy expression with units.
detect_unit_args
- unit_expr (Any): SymPy expression representing a composite unit.
PhysicsSolutionComparator
- solution (str): The output from running the solution code.
- reference_answer (str): The reference answer to compare against.
- float_tolerance (Optional[float], optional): The tolerance for floating point comparisons. (default: :obj:
None
)
init
_split_value_unit
- s (str): The input string.
_clean_answer
- raw_answer (str): The raw answer string potentially containing LaTeX formatting.
_parse_expression
- expr (Any): Expression to parse, can be a string, number, or other type.
_is_number
- s (Any): Value to check.
_detect_tolerance
_convert_units
verify_unit
compare_solution_to_reference
_get_value_unit_pairs
_compare_numeric_values
_compare_symbolic_values
PhysicsVerifier
- extractor (Optional[BaseExtractor]): The extractor to use for extracting code from messages. (default: :obj:
None
) - timeout (Optional[float]): The timeout for code execution in seconds. (default: :obj:
30.0
) - required_packages (Optional[List[str]]): The required packages for code execution. (default: :obj:
None
) - float_tolerance (Optional[float]): The relative tolerance used to compare numerical values. (default: :obj:
None
) **kwargs: Additional keyword arguments to pass to the parent class.