Skip to content

Commit

Permalink
new format (#72)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshuaLampert authored Nov 30, 2023
1 parent 4a585a2 commit 1af059b
Showing 1 changed file with 12 additions and 18 deletions.
30 changes: 12 additions & 18 deletions src/callbacks_step/analysis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,10 @@ end
Return the time values that correspond to the saved values of the [`errors`](@ref) and [`integrals`](@ref).
"""
function tstops(cb::DiscreteCallback{
Condition,
Affect!
}) where {Condition,
Affect! <:
AnalysisCallback}
function tstops(cb::DiscreteCallback{Condition,
Affect!}) where {Condition,
Affect! <:
AnalysisCallback}
analysis_callback = cb.affect!
return analysis_callback.tstops
end
Expand All @@ -124,12 +122,10 @@ end
Return the computed errors for each timestep as a named tuple.
The shape of each entry is (nvariables, ntimesteps).
"""
function errors(cb::DiscreteCallback{
Condition,
Affect!
}) where {Condition,
Affect! <:
AnalysisCallback}
function errors(cb::DiscreteCallback{Condition,
Affect!}) where {Condition,
Affect! <:
AnalysisCallback}
analysis_callback = cb.affect!
names = collect(analysis_callback.analysis_errors)
# "transpose" vector of matrices, first write it as 3d array and then convert it back to vector of matrices
Expand All @@ -144,12 +140,10 @@ end
Return the computed integrals for each timestep as a named tuple.
"""
function integrals(cb::DiscreteCallback{
Condition,
Affect!
}) where {Condition,
Affect! <:
AnalysisCallback}
function integrals(cb::DiscreteCallback{Condition,
Affect!}) where {Condition,
Affect! <:
AnalysisCallback}
analysis_callback = cb.affect!
names = collect(Symbol.(nameof.(analysis_callback.analysis_integrals)))
# "transpose" vector of vector
Expand Down

0 comments on commit 1af059b

Please sign in to comment.