Skip to content

Commit

Permalink
fix: fix function with zero with units arg regression
Browse files Browse the repository at this point in the history
  • Loading branch information
mgreminger committed Jan 9, 2025
1 parent c799317 commit 3caee93
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions public/dimensional_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -1517,13 +1517,12 @@ def replace_placeholder_funcs(expr: Expr,
function_parents: list[Basic],
data_table_subs: DataTableSubs | None) -> Expr:

if (not is_matrix(expr)):
if isinstance(expr, Symbol) and expr.name == "_zero_delayed_substitution":
return sympify('0')
if (not is_matrix(expr)) and expr.func == function_id_wrapper:
function_parents.append(expr.args[0])
expr = cast(Expr, expr.args[1])

elif expr.func == function_id_wrapper:
function_parents.append(expr.args[0])
expr = cast(Expr, expr.args[1])
if (not is_matrix(expr)) and isinstance(expr, Symbol) and expr.name == "_zero_delayed_substitution":
return sympify('0')

if is_matrix(expr):
rows = []
Expand Down

0 comments on commit 3caee93

Please sign in to comment.