Skip to content

Commit 609bc23

Browse files
authored
Merge pull request #175 from control-toolbox/print
Up print
2 parents 3b9c6d0 + 06da6dd commit 609bc23

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "CTModels"
22
uuid = "34c4fa32-2049-4079-8329-de33c2a22e2d"
33
authors = ["Olivier Cots <olivier.cots@toulouse-inp.fr>"]
4-
version = "0.6.0"
4+
version = "0.6.1"
55

66
[deps]
77
CTBase = "54762871-cc72-4466-b8e8-f6c8b58076cd"

src/print.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ function Base.show(io::IO, ::MIME"text/plain", ocp::Model)
2020

2121
# ------------------------------------------------------------------------------ #
2222
# print the code
23+
printstyled(io, "Abstract defintion:\n\n"; bold=true)
2324
tab = 4
2425
code = striplines(definition(ocp))
2526
@match code.head begin
@@ -225,7 +226,7 @@ function Base.show(io::IO, ::MIME"text/plain", ocp::Model)
225226
#
226227
some_printing && println(io)
227228
printstyled(io, "Declarations "; bold=true)
228-
printstyled(io, "(* required):\n"; bold=false)
229+
printstyled(io, "(* required):\n"; bold=true)
229230
#println(io)
230231

231232
# print table of settings
@@ -293,6 +294,7 @@ function Base.show(io::IO, ::MIME"text/plain", ocp::PreModel)
293294

294295
# ------------------------------------------------------------------------------ #
295296
# print the code
297+
printstyled(io, "Abstract defintion:\n\n"; bold=true)
296298
tab = 4
297299
code = striplines(definition(ocp))
298300
@match code.head begin
@@ -512,7 +514,7 @@ function Base.show(io::IO, ::MIME"text/plain", ocp::PreModel)
512514
#
513515
some_printing && println(io)
514516
printstyled(io, "Declarations "; bold=true)
515-
printstyled(io, "(* required):\n"; bold=false)
517+
printstyled(io, "(* required):\n"; bold=true)
516518
#println(io)
517519

518520
# print table of settings

test/extras/print_model.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using Pkg
2-
Pkg.activate("./")
2+
Pkg.activate(".")
33

44
using CTBase
55
using CTModels

test/solution_example.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ function solution_example(; fun=false)
1212
# set control
1313
CTModels.control!(pre_ocp, 1)
1414

15-
pre_ocp_returned = deepcopy(pre_ocp)
16-
1715
# set control
1816
CTModels.variable!(pre_ocp, 2)
1917

@@ -54,6 +52,8 @@ function solution_example(; fun=false)
5452

5553
CTModels.time_dependence!(pre_ocp; autonomous=false)
5654

55+
pre_ocp_returned = deepcopy(pre_ocp)
56+
5757
# build model
5858
ocp = CTModels.build(pre_ocp)
5959

0 commit comments

Comments
 (0)