Skip to content

Commit 01b76ab

Browse files
committed
init
1 parent ec17278 commit 01b76ab

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697"
88
ArrayInterface = "4fba245c-0d91-5ea0-9b3e-6abc04ee57a9"
99
RuntimeGeneratedFunctions = "7e49a35a-f44a-4d26-94aa-eba1b4ca6b47"
1010
StaticArraysCore = "1e83bf80-4336-4d27-bf5d-d5a4f845583c"
11+
Term = "22787eb5-b846-44ae-b979-8e399b8463ab"
1112

1213
[compat]
1314
Accessors = "0.1.36"
@@ -18,6 +19,7 @@ RuntimeGeneratedFunctions = "0.5.12"
1819
SafeTestsets = "0.0.1"
1920
StaticArrays = "1.9"
2021
StaticArraysCore = "1.4"
22+
Term = "2.0.7"
2123
Test = "1"
2224
Zygote = "0.6.67"
2325
julia = "1.10"

src/SymbolicIndexingInterface.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ using RuntimeGeneratedFunctions
44
import StaticArraysCore: MArray, similar_type
55
import ArrayInterface
66
using Accessors: @reset
7+
import Term: Table # for pretty-printing
78

89
RuntimeGeneratedFunctions.init(@__MODULE__)
910

src/parameter_indexing_proxy.jl

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,20 @@ end
1717
function Base.setindex!(p::ParameterIndexingProxy, val, idx)
1818
return setp(p.wrapped, idx)(p.wrapped, val)
1919
end
20+
21+
function Base.show(io::IO, pip::ParameterIndexingProxy; kwargs...)
22+
params = Any[]
23+
vals = Any[]
24+
for p in parameter_symbols(pip.wrapped)
25+
push!(params, p)
26+
val = getp(pip.wrapped, p)(pip.wrapped)
27+
push!(vals, val)
28+
end
29+
30+
print(
31+
Table([params vals];
32+
box=:SIMPLE,
33+
header=["Parameter", "Value"],
34+
kwargs...)
35+
)
36+
end

0 commit comments

Comments
 (0)