From bec2e6e0c4ce307aa2da8094fde19a974106c1e9 Mon Sep 17 00:00:00 2001 From: mgreminger Date: Fri, 10 Jan 2025 22:49:40 -0600 Subject: [PATCH] fix: fix dimensional analysis regression Check wasn't working for non-sympy dimension exponents --- public/dimensional_analysis.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/public/dimensional_analysis.py b/public/dimensional_analysis.py index 6da84e70..9ddc462f 100644 --- a/public/dimensional_analysis.py +++ b/public/dimensional_analysis.py @@ -780,6 +780,11 @@ def custom_get_dimensional_dependencies_for_name(self, dimension): for d in dicts: keys_to_remove = set() for key, exp in d.items(): + if isinstance(exp, int): + exp = sympify(float(exp)) + elif isinstance(exp, float): + exp = sympify(exp) + new_exp = exp.round(EXP_NUM_DIGITS) if new_exp == sympify("0"): keys_to_remove.add(key)