Skip to content

Commit f1cc897

Browse files
committed
assume simplify always returns Expression
1 parent 9129623 commit f1cc897

File tree

5 files changed

+3
-7
lines changed

5 files changed

+3
-7
lines changed

src/differentials.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function expand_derivatives(O::Operation)
5252
end |> simplify_constants
5353
end
5454

55-
return O |> simplify_constants
55+
return simplify_constants(O)
5656
end
5757
expand_derivatives(x) = x
5858

src/direct.jl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ function simplified_expr(O::Operation)
5050
end
5151

5252
simplified_expr(c::Constant) = c.value
53-
simplified_expr(c) = c
5453

5554
function simplified_expr(eq::Equation)
5655
Expr(:(=), simplified_expr(eq.lhs), simplified_expr(eq.rhs))

src/systems/abstractsystem.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,4 +216,4 @@ function (f::AbstractSysToExpr)(O::Operation)
216216
end
217217
return build_expr(:call, Any[O.op; f.(O.args)])
218218
end
219-
(f::AbstractSysToExpr)(x) = to_Expr(x)
219+
(f::AbstractSysToExpr)(x) = convert(Expr, x)

src/systems/diffeqs/abstractodesystem.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ function (f::ODEToExpr)(O::Operation)
3434
end
3535
return build_expr(:call, Any[Symbol(O.op); f.(O.args)])
3636
end
37-
(f::ODEToExpr)(x) = to_Expr(x)
37+
(f::ODEToExpr)(x) = convert(Expr, x)
3838

3939
function generate_tgrad(sys::AbstractODESystem, dvs = states(sys), ps = parameters(sys); kwargs...)
4040
tgrad = calculate_tgrad(sys)

src/utils.jl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,3 @@ function substitute_expr!(expr::Operation, s::Pair{Operation, Operation})
114114
end
115115
return nothing
116116
end
117-
118-
to_Expr(x::Expression) = convert(Expr, x)
119-
to_Expr(x::Number) = to_Expr(Constant(x))

0 commit comments

Comments
 (0)