Skip to content

Commit

Permalink
Fix printing
Browse files Browse the repository at this point in the history
  • Loading branch information
gdalle committed Sep 17, 2024
1 parent 50ce141 commit 31a76d4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
10 changes: 3 additions & 7 deletions src/dense.jl
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,6 @@ function Base.show(io::IO, backend::AutoForwardDiff{chunksize}) where {chunksize
print(io, ")")
end


"""
AutoGTPSA{D}
Expand All @@ -201,11 +200,10 @@ Defined by [ADTypes.jl](https://github.com/SciML/ADTypes.jl).
- `descriptor::D`: can be either
+ a GTPSA `Descriptor` specifying the number of variables/parameters, parameter
order, individual variable/parameter truncation orders, and maximum order. See
+ a GTPSA `Descriptor` specifying the number of variables/parameters, parameter
order, individual variable/parameter truncation orders, and maximum order. See
the [GTPSA.jl documentation](https://bmad-sim.github.io/GTPSA.jl/stable/man/c_descriptor/) for more details.
+ `nothing` to automatically use a `Descriptor` given the context.
"""
Base.@kwdef struct AutoGTPSA{D} <: AbstractADType
descriptor::D = nothing
Expand All @@ -215,12 +213,10 @@ mode(::AutoGTPSA) = ForwardMode()

function Base.show(io::IO, backend::AutoGTPSA{D}) where {D}
print(io, AutoGTPSA, "(")
D != Nothing && print(io, "descriptor=\n", repr(backend.descriptor; context = io))
D != Nothing && print(io, "descriptor=", repr(backend.descriptor; context = io))
print(io, ")")
end



"""
AutoPolyesterForwardDiff{chunksize,T}
Expand Down
2 changes: 2 additions & 0 deletions test/misc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ for backend in [
ADTypes.AutoFiniteDifferences(; fdm = :fdm),
ADTypes.AutoForwardDiff(),
ADTypes.AutoForwardDiff(chunksize = 3, tag = :tag),
ADTypes.AutoGTPSA(),
ADTypes.AutoGTPSA(; descriptor = Val(:descriptor)),
ADTypes.AutoPolyesterForwardDiff(),
ADTypes.AutoPolyesterForwardDiff(chunksize = 3, tag = :tag),
ADTypes.AutoReverseDiff(),
Expand Down
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function every_ad_with_options()
AutoForwardDiff(),
AutoForwardDiff(chunksize = 3, tag = :tag),
AutoGTPSA(),
AutoGTPSA(descriptor=:descriptor),
AutoGTPSA(descriptor = Val(:descriptor)),
AutoPolyesterForwardDiff(),
AutoPolyesterForwardDiff(chunksize = 3, tag = :tag),
AutoReverseDiff(),
Expand Down

0 comments on commit 31a76d4

Please sign in to comment.