Skip to content

Commit

Permalink
refactor: remove unnecessary doit() calls for dimensional analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
mgreminger committed Nov 1, 2024
1 parent c6e5465 commit 453ac7e
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions public/dimensional_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -1511,24 +1511,6 @@ def replace_sympy_funcs_with_placeholder_funcs(expression: Expr) -> Expr:

return expression


def doit_for_dim_func(func):
def new_func(expr: Expr,
func_key: Literal["dim_func"] | Literal["sympy_func"],
placeholder_map: dict[Function, PlaceholderFunction],
placeholder_set: set[Function],
data_table_subs: DataTableSubs | None) -> Expr:
result = func(expr, func_key, placeholder_map,
placeholder_set, data_table_subs)

if func_key == "dim_func":
return cast(Expr, result.doit())
else:
return result

return new_func

@doit_for_dim_func
def replace_placeholder_funcs(expr: Expr,
func_key: Literal["dim_func"] | Literal["sympy_func"],
placeholder_map: dict[Function, PlaceholderFunction],
Expand Down

0 comments on commit 453ac7e

Please sign in to comment.