Skip to content

Commit

Permalink
fix: fix dimensional analysis regression
Browse files Browse the repository at this point in the history
Check wasn't working for non-sympy dimension exponents
  • Loading branch information
mgreminger committed Jan 11, 2025
1 parent 1e23b20 commit bec2e6e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions public/dimensional_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit bec2e6e

Please sign in to comment.