Skip to content

Commit d587d00

Browse files
Merge pull request #148 from ChrisRackauckas-Claude/fix-deprecation-warnings
Fix deprecation warnings
2 parents df5417f + 0ca7355 commit d587d00

File tree

2 files changed

+3
-68
lines changed

2 files changed

+3
-68
lines changed

src/ParameterizedFunctions.jl

Lines changed: 0 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
__precompile__()
2-
31
"""
42
$(DocStringExtensions.README)
53
"""
@@ -27,66 +25,3 @@ module ParameterizedFunctions
2725

2826
export @ode_def, ode_def_opts, @ode_def_bare, @ode_def_all
2927
end # module
30-
31-
##### Extra
32-
33-
# Jacobian Factorization
34-
35-
#=
36-
local fsymjac_L
37-
local fsymjac_U
38-
local Jex_L
39-
local Jex_U
40-
try
41-
# Factorize the Jacobian
42-
fsymjac = lufact(symjac)
43-
fsymjac_L = fsymjac[:L]
44-
fsymjac_U = fsymjac[:U]
45-
Jex_L,Jex_U = build_fjac_func(fsymjac_L,fsymjac_U,indvar_dict,param_dict,inline_dict)
46-
catch
47-
fsymjac_L = Matrix{SymEngine.Basic}(0,0)
48-
fsymjac_U = Matrix{SymEngine.Basic}(0,0)
49-
end
50-
51-
"""
52-
Builds the LU-factorized Jacobian functions
53-
"""
54-
function build_fjac_func(symjac_L,symjac_U,indvar_dict,param_dict,inline_dict)
55-
# Lower Triangle
56-
Jex = :()
57-
for i in 1:size(symjac_L,1)
58-
for j in 1:i
59-
ex = parse(string(symjac_L[i,j]))
60-
if ex isa Expr
61-
ode_findreplace(ex,ex,indvar_dict,param_dict,inline_dict)
62-
else
63-
ex = ode_symbol_findreplace(ex,indvar_dict,param_dict,inline_dict)
64-
end
65-
push!(Jex.args,:(J[$i,$j] = $ex))
66-
end
67-
end
68-
Jex.head = :block
69-
push!(Jex.args,nothing)
70-
Jex_L = :(jac = (t,u,J)->$Jex)
71-
72-
# Upper Triangle
73-
Jex = :()
74-
for j in 1:size(symjac_U,2)
75-
for i in 1:j
76-
ex = parse(string(symjac_U[i,j]))
77-
if ex isa Expr
78-
ode_findreplace(ex,ex,indvar_dict,param_dict,inline_dict)
79-
else
80-
ex = ode_symbol_findreplace(ex,indvar_dict,param_dict,inline_dict)
81-
end
82-
push!(Jex.args,:(J[$i,$j] = $ex))
83-
end
84-
end
85-
Jex.head = :block
86-
push!(Jex.args,nothing)
87-
Jex_U = :(jac = (t,u,J)->$Jex)
88-
89-
Jex_L,Jex_U
90-
end
91-
92-
=#

src/dict_build.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ function build_indvar_dict(ex, depvar)
77
if firstarg == :d
88
nodarg = Symbol(join(Base.Iterators.drop(string(arg), 1)))
99
if nodarg == depvar
10-
warn("$depvar is fixed as the independent variable but is also used as a dependent variable. Results my be incorrect.")
10+
@warn "$depvar is fixed as the independent variable but is also used as a dependent variable. Results may be incorrect."
1111
end
1212
if !haskey(indvar_dict, nodarg)
1313
cur_sym += 1
@@ -27,8 +27,8 @@ function build_param_list(params)
2727
if params[i] isa Symbol
2828
push!(param_list, params[i])
2929
elseif params[i].head == :call || params[i].head == :(=)
30-
warn("p=>val and p=val are deprecated. Simply list the parameters. See the DifferentialEquations.jl documentation for more information on the syntax change.")
30+
@warn "p=>val and p=val are deprecated. Simply list the parameters. See the DifferentialEquations.jl documentation for more information on the syntax change."
3131
end
3232
end
33-
return param_dict
33+
return param_list
3434
end

0 commit comments

Comments
 (0)