Hi,
I’m having a world age problem in a very weird way, or at least weird enough that I can’t see the similarities with other examples.
I have a file simulationFns.jl
that defines a few functions such as:
using LiiBRA
function sim_degradation!(args...)
# bunch of things that work
end
function simulate_storage!(args...)
# unpacking the data and so on
# initialization and data extraction as in the example from LiiBRA
SList = collect(1.0:-0.1:0) # List of SOC points for model generation
SoC0 = 0.8; # Starting SOC
Sₑ = 4 # Spatial points in electrolyte
Sₛ = 2 # Spatial point in solid
Base.invokelatest(LiiBRA.Spatial!, Cell, Sₑ, Sₛ) <-- this works
A, B, C, D = LiiBRA.Realise(Cell, SList) <--- error here
# rest of the function
end
function simTransitionFun(args...)
# first, a bunch of things that work
# here we call the prev defined function
simulate_storage!(args...)
return println("foo")
end
then in a script file I’m doing
using Revise
includet(".../simulationFns.jl")
## load a bunch of data to use the functions
# First try
simulate_storage_asset!(args...) # <--- works pass by the LiiBRA.Realise() line
# Second try
simTransitionFun!(args...) # <--- crashes in the LiiBRA.Realise() line
Full stacktrace
LoadError: MethodError: no method matching (::LiiBRA.var"#308#312")(::Int64, ::Int64)
The applicable method may be too new: running in world age 32311, while current world is 32430.
Closest candidates are:
(::LiiBRA.var"#308#312")(::Any, ::Any) (method too new to be called from this world context.)
@ LiiBRA C:\Users\user\.julia\packages\LiiBRA\DNSWZ\src\Data\Chen_2020\LG_M50.jl:160
Stacktrace:
[1] Realise(Cell::LiiBRA.Params, SList::Vector{Float64})
@ LiiBRA C:\Users\user\.julia\packages\LiiBRA\DNSWZ\src\Functions\LiiBRA.jl:31
[2] simulate_storage_asset!(stgAsset::BESSData, results::Dict{String, Any}, key::String)
@ Main c:\Users\user\OneDrive folder\simulationFuns.jl:128
[3] simTransitionFun!(results::Dict{String, Any}, data::Dict{String, Any}, s::modelSettings; typeOpt::String)
@ Main c:\Users\user\OneDrive folder\simulationFuns.jl:227
[4] top-level scope
@ c:\Users\user\OneDrive folder\dbgTest1.jl:43
[5] eval
@ .\boot.jl:385 [inlined]
[6] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)
@ Base .\loading.jl:2070
[7] invokelatest(::Any, ::Any, ::Vararg{Any}; kwargs::@Kwargs{})
@ Base .\essentials.jl:887
[8] invokelatest(::Any, ::Any, ::Vararg{Any})
@ Base .\essentials.jl:884
[9] inlineeval(m::Module, code::String, code_line::Int64, code_column::Int64, file::String; softscope::Bool)
@ VSCodeServer c:\Users\user\.vscode\extensions\julialang.language-julia-1.66.2\scripts\packages\VSCodeServer\src\eval.jl:263
[10] (::VSCodeServer.var"#67#72"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams})()
@ VSCodeServer c:\Users\user\.vscode\extensions\julialang.language-julia-1.66.2\scripts\packages\VSCodeServer\src\eval.jl:181
[11] withpath(f::VSCodeServer.var"#67#72"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams}, path::String)
@ VSCodeServer c:\Users\user\.vscode\extensions\julialang.language-julia-1.66.2\scripts\packages\VSCodeServer\src\repl.jl:274
[12] (::VSCodeServer.var"#66#71"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams})()
@ VSCodeServer c:\Users\user\.vscode\extensions\julialang.language-julia-1.66.2\scripts\packages\VSCodeServer\src\eval.jl:179
[13] hideprompt(f::VSCodeServer.var"#66#71"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams})
@ VSCodeServer c:\Users\user\.vscode\extensions\julialang.language-julia-1.66.2\scripts\packages\VSCodeServer\src\repl.jl:38
[14] (::VSCodeServer.var"#65#70"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams})()
@ VSCodeServer c:\Users\user\.vscode\extensions\julialang.language-julia-1.66.2\scripts\packages\VSCodeServer\src\eval.jl:150
[15] with_logstate(f::Function, logstate::Any)
@ Base.CoreLogging .\logging.jl:515
[16] with_logger
@ .\logging.jl:627 [inlined]
[17] (::VSCodeServer.var"#64#69"{VSCodeServer.ReplRunCodeRequestParams})()
@ VSCodeServer c:\Users\user\.vscode\extensions\julialang.language-julia-1.66.2\scripts\packages\VSCodeServer\src\eval.jl:255
[18] #invokelatest#2
@ Base .\essentials.jl:887 [inlined]
[19] invokelatest(::Any)
@ Base .\essentials.jl:884
[20] (::VSCodeServer.var"#62#63")()
@ VSCodeServer c:\Users\user\.vscode\extensions\julialang.language-julia-1.66.2\scripts\packages\VSCodeServer\src\eval.jl:34
in expression starting at c:\Users\user\OneDrive folder\dbgTest1.jl:43
What is going on, then? Why can’t I use functions from a package layered in 2 functions?
Why can I call any function from LiiBRA.jl
in the REPL but I can’t use them like this?
This has never happened to me before with any other packages.