@@ -104,6 +104,10 @@ const ConstraintsDictType = OrderedDict{
104104#
105105include (" default.jl" )
106106
107+ #
108+ include (" utils.jl" )
109+ include (" types.jl" )
110+
107111# export / import
108112"""
109113$(TYPEDEF)
@@ -132,28 +136,28 @@ $(TYPEDSIGNATURES)
132136
133137Export a solution in JLD format.
134138"""
135- export_ocp_solution (:: JLD2Tag , args ... ; kwargs ... ) = throw (CTBase. ExtensionError (:JLD2 ))
139+ export_ocp_solution (:: JLD2Tag , :: AbstractSolution ; filename :: String ) = throw (CTBase. ExtensionError (:JLD2 ))
136140
137141"""
138142$(TYPEDSIGNATURES)
139143
140144Import a solution from a JLD file.
141145"""
142- import_ocp_solution (:: JLD2Tag , args ... ; kwargs ... ) = throw (CTBase. ExtensionError (:JLD2 ))
146+ import_ocp_solution (:: JLD2Tag , :: AbstractModel ; filename :: String ) = throw (CTBase. ExtensionError (:JLD2 ))
143147
144148"""
145149$(TYPEDSIGNATURES)
146150
147151Export a solution in JSON format.
148152"""
149- export_ocp_solution (:: JSON3Tag , args ... ; kwargs ... ) = throw (CTBase. ExtensionError (:JSON3 ))
153+ export_ocp_solution (:: JSON3Tag , :: AbstractSolution ; filename :: String ) = throw (CTBase. ExtensionError (:JSON3 ))
150154
151155"""
152156$(TYPEDSIGNATURES)
153157
154158Import a solution from a JLD file.
155159"""
156- import_ocp_solution (:: JSON3Tag , args ... ; kwargs ... ) = throw (CTBase. ExtensionError (:JSON3 ))
160+ import_ocp_solution (:: JSON3Tag , :: AbstractModel ; filename :: String ) = throw (CTBase. ExtensionError (:JSON3 ))
157161
158162"""
159163$(TYPEDSIGNATURES)
@@ -167,11 +171,11 @@ julia> CTModels.export_ocp_solution(sol; filename="solution", format=:JSON)
167171julia> CTModels.export_ocp_solution(sol; filename="solution", format=:JLD)
168172```
169173"""
170- function export_ocp_solution (args ... ; format:: Symbol = __format (), kwargs ... )
174+ function export_ocp_solution (sol :: AbstractSolution ; format:: Symbol = __format (), filename :: String = __filename_export_import () )
171175 if format == :JLD
172- return export_ocp_solution (JLD2Tag (), args ... ; kwargs ... )
176+ return export_ocp_solution (JLD2Tag (), sol; filename = filename )
173177 elseif format == :JSON
174- return export_ocp_solution (JSON3Tag (), args ... ; kwargs ... )
178+ return export_ocp_solution (JSON3Tag (), sol; filename = filename )
175179 else
176180 throw (
177181 CTBase. IncorrectArgument (
@@ -193,11 +197,11 @@ julia> sol = CTModels.import_ocp_solution(ocp; filename="solution", format=:JSON
193197julia> sol = CTModels.import_ocp_solution(ocp; filename="solution", format=:JLD)
194198```
195199"""
196- function import_ocp_solution (args ... ; format:: Symbol = __format (), kwargs ... )
200+ function import_ocp_solution (ocp :: AbstractModel ; format:: Symbol = __format (), filename :: String = __filename_export_import () )
197201 if format == :JLD
198- return import_ocp_solution (JLD2Tag (), args ... ; kwargs ... )
202+ return import_ocp_solution (JLD2Tag (), ocp; filename = filename )
199203 elseif format == :JSON
200- return import_ocp_solution (JSON3Tag (), args ... ; kwargs ... )
204+ return import_ocp_solution (JSON3Tag (), ocp; filename = filename )
201205 else
202206 throw (
203207 CTBase. IncorrectArgument (
@@ -207,10 +211,6 @@ function import_ocp_solution(args...; format::Symbol=__format(), kwargs...)
207211 end
208212end
209213
210- #
211- include (" utils.jl" )
212- include (" types.jl" )
213-
214214# to be extended
215215"""
216216$(TYPEDSIGNATURES)
0 commit comments