control-toolbox / OptimalControl.jl

Solvers of optimal control problems
MIT License
28 stars 5 forks source link

Error in Goddard example #164

Closed horasio closed 2 months ago

horasio commented 3 months ago

Julia 1.10.2. Up-to-date modules, as of 2024-03-29. I've copied the example code into a single file, and I include() it. It did work a few weeks ago. But does not work anymore; see error message below. I'm very new to Julia, so it may be a bug from my Julia installation due to a mistake from me, but I don't know how to check that.

To start, you should set the name of the optimal control problem and the name of the solution.
For example, you can type:

    ct> NAME=(ocp, sol)

┌ Warning: REPL key '>' overwritten.
└ @ ReplMaker ~/.julia/packages/ReplMaker/ViCwA/src/ReplMaker.jl:96
ERROR: LoadError: deepcopy of Modules not supported
Stacktrace:
  [1] error(s::String)
    @ Base ./error.jl:35
  [2] deepcopy_internal(x::Module, stackdict::IdDict{Any, Any})
    @ Base ./deepcopy.jl:33
  [3] deepcopy_internal(x::Any, stackdict::IdDict{Any, Any}) (repeats 2 times)
    @ Base ./deepcopy.jl:65
  [4] deepcopy_internal(x::Any, stackdict::IdDict{Any, Any})
    @ Base ./deepcopy.jl:76
  [5] deepcopy_internal(x::Any, stackdict::IdDict{Any, Any}) (repeats 2 times)
    @ Base ./deepcopy.jl:65
  [6] deepcopy_internal(x::Any, stackdict::IdDict{Any, Any})
    @ Base ./deepcopy.jl:76
  [7] deepcopy_internal(x::Dict{Char, Any}, stackdict::IdDict{Any, Any})
    @ Base ./deepcopy.jl:125
  [8] deepcopy_internal(x::Any, stackdict::IdDict{Any, Any}) (repeats 3 times)
    @ Base ./deepcopy.jl:65
  [9] deepcopy_internal(x::Any, stackdict::IdDict{Any, Any})
    @ Base ./deepcopy.jl:76
 [10] deepcopy_internal(x::Dict{Char, Any}, stackdict::IdDict{Any, Any})
    @ Base ./deepcopy.jl:125
 [11] deepcopy_internal(x::Any, stackdict::IdDict{Any, Any})
    @ Base ./deepcopy.jl:65
 [12] deepcopy_internal(x::Any, stackdict::IdDict{Any, Any})
    @ Base ./deepcopy.jl:76
 [13] deepcopy(x::Any)
    @ Base ./deepcopy.jl:26
 [14] initrepl(parser::CTBase.var"#parse_to_expr#202"{…}; prompt_text::String, prompt_color::Symbol, start_key::Char, repl::REPL.LineEditREPL, mode_name::String, show_function::Nothing, show_function_io::Base.TTY, valid_input_checker::Function, keymap::Dict{…}, completion_provider::REPL.REPLCompletionProvider, sticky_mode::Bool, startup_text::Bool)
    @ ReplMaker ~/.julia/packages/ReplMaker/ViCwA/src/ReplMaker.jl:97
 [15] ct_repl(; debug::Bool, demo::Bool)
    @ CTBase ~/.julia/packages/CTBase/Q5D7A/src/repl.jl:117
 [16] ct_repl()
    @ CTBase ~/.julia/packages/CTBase/Q5D7A/src/repl.jl:21
 [17] top-level scope
    @ ~/.julia/packages/OptimalControl/Q1TQs/src/OptimalControl.jl:61
 [18] include(mod::Module, _path::String)
    @ Base ./Base.jl:495
 [19] _require(pkg::Base.PkgId, env::String)
    @ Base ./loading.jl:2014
 [20] __require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1812
 [21] #invoke_in_world#3
    @ ./essentials.jl:926 [inlined]
 [22] invoke_in_world
    @ ./essentials.jl:923 [inlined]
 [23] _require_prelocked(uuidkey::Base.PkgId, env::String)
    @ Base ./loading.jl:1803
 [24] macro expansion
    @ ./loading.jl:1790 [inlined]
 [25] macro expansion
    @ ./lock.jl:267 [inlined]
 [26] __require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1753
 [27] #invoke_in_world#3
    @ ./essentials.jl:926 [inlined]
 [28] invoke_in_world
    @ ./essentials.jl:923 [inlined]
 [29] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:1746
 [30] include(fname::String)
    @ Base.MainInclude ./client.jl:489
 [31] top-level scope
    @ REPL[2]:1
in expression starting at /Users/LOGIN/.julia/packages/OptimalControl/Q1TQs/src/OptimalControl.jl:1
in expression starting at /Users/LOGIN/Projects/launchers/goddard/goddard-ct.jl:1
Some type information was truncated. Use `show(err)` to see complete types.
ocots commented 3 months ago

Thanks for the message. I have the same problem. Actually, there are many changes from the new release of Julia and we need to clean our package.

ocots commented 3 months ago

This should be ok also now! Thanks again @horasio!

ocots commented 3 months ago

Need to:

]
pkg> update
jbcaillau commented 2 months ago

@horasio note that the REPL feature is rather experimental (though nice)