From 13ba7230ea56b623ea9bb53e12b4ac65c8424fe4 Mon Sep 17 00:00:00 2001 From: Olivier Cots Date: Sun, 25 Aug 2024 11:28:51 +0200 Subject: [PATCH] fix docs --- ext/CTDirectExt.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/CTDirectExt.jl b/ext/CTDirectExt.jl index d9eb6f7..bd8177b 100644 --- a/ext/CTDirectExt.jl +++ b/ext/CTDirectExt.jl @@ -32,8 +32,8 @@ $(TYPEDSIGNATURES) Export OCP solution in JSON format """ -# +++ redo this, start with basics function CTDirect.export_ocp_solution(sol::OptimalControlSolution; filename_prefix="solution") +# +++ redo this, start with basics open(filename_prefix * ".json", "w") do io #JSON3.pretty(io, CTDirect.OCPDiscreteSolution(sol)) end @@ -45,8 +45,8 @@ $(TYPEDSIGNATURES) Read OCP solution in JSON format """ -# +++ add constructor from json blob function CTDirect.import_ocp_solution(filename_prefix="solution") +# +++ add constructor from json blob json_string = read(filename_prefix * ".json", String) return OptimalControlSolution(JSON3.read(json_string)) end