Skip to content

Commit

Permalink
Fix package name printing (#517)
Browse files Browse the repository at this point in the history
  • Loading branch information
gdalle authored Sep 30, 2024
1 parent 7a09754 commit 3f29b61
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion DifferentiationInterface/src/utils/printing.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
function package_name(b::AbstractADType)
s = string(b)
s = chopprefix(s, "ADTypes.")
s = chopprefix(s, "Auto")
k = findfirst('(', s)
isnothing(k) && throw(ArgumentError("Cannot parse backend into package"))
return s[5:(k - 1)]
return s[begin:(k - 1)]
end

function package_name(b::SecondOrder)
Expand Down

0 comments on commit 3f29b61

Please sign in to comment.