Solver Trace Columns
SolverTraces.TraceColumn
— TypeTraceColumn
Base type for all columns that can appear in a SolverTrace
. Each subtype is expected to have a property named fmt
containing a formatting string, and to be callable with the current step number as argument, returning the necessary values to render the formatting string, alternatively overload Format.format(c::C, i::Integer) where {C<:TraceColumn}
.
CurrentStep
SolverTraces.CurrentStep
— TypeCurrentStep(num_steps, fmt, lc, header)
Trace column display the current step and total number of iteration, e.g. [ 4/10]
, with the figures colored according to progress made.
SolverTraces.CurrentStep
— MethodCurrentStep(num_step[; lc, header])
Create a current step trace column for num_step
iterations. The default color scale goes from red to green, and the default header is blank.
Performance
SolverTraces.Performance
— TypePerformance(load, header, t₀, fmt)
This trace column can be used to indicate the performance of a calculation, i.e. how many units (grid points, particles, &c) can the algorithm handle per second. The number is shifted to the appropriate order of magnitude, changing the SI prefix to e.g. kHz
, MHz
, &c.
SolverTraces.Performance
— TypePerformance(load[, load_name="Performance"])
Constructe a Performance
trace column, for load
number of units per iteration.
SolverTraces.shift_prefix
— Functionshift_prefix(u, e)
Shift the SI prefix of the unit u
by e
orders of magnitude (which needs to be a multiple of 3).
SolverTraces.SI_prefix_convert
— FunctionSI_prefix_convert(q)
Shift the SI prefix of the quantity q
such that no zeros appear before the decimal point, and at most three figures do. Note that this conversion is not necessarily numerically accurate, it is mostly intended for display purposes.
Examples
julia> SolverTraces.SI_prefix_convert(1.0u"nm")
1.0 nm
julia> SolverTraces.SI_prefix_convert(0.10u"nm")
100.0 pm
julia> SolverTraces.SI_prefix_convert(100.0u"nm")
100.0 nm
julia> SolverTraces.SI_prefix_convert(999.0u"nm")
999.0 nm
ETA
SolverTraces.ETA
— TypeETA(steps, header, t₀, fmt)
This trace column can be used to indicate the estimated time of completion of a calculation.
ScalarColumn
SolverTraces.ScalarColumn
— TypeScalarColumn(fmt, header, n)
Trace column for any kind of scalar, returned by the callback function n
. Alternatively, n
can be a scalar set manually by the user.
SolverTraces.ScalarColumn
— MethodScalarColumn(n, header, ::Type{R}[, signed=false]) where {R<:Real}
Construct a ScalarColumn
for the callback function n
, with a format automatically generated depending on R
is an integer or not, and whether it can be signed.
SolverTraces.ScalarColumn
— MethodScalarColumn(n::R, header[, signed=false]) where {R<:Real}
Construct a ScalarColumn
for the scalar value n
, with a format automatically generated depending on R
is an integer or not, and whether it can be signed.
Tolerance
SolverTraces.Tolerance
— TypeTolerance(target, current, fmt, tol_fmt, lc, header)
Column displaying the progress of the algorithm towards a set target
. At each iteration, the current
value has to be updated.
SolverTraces.Tolerance
— Method Tolerance(target[, header; print_target])
Construct a new Tolerance
column with a set target
.
SolverTraces.base_exp
— Functionbase_exp(v)
Convert the float v
into a tuple of base and exponent in base-10.
Examples
julia> SolverTraces.base_exp(-3.5e2)
(-3.5000000000000004, 2)
ColumnSeparator
SolverTraces.ColumnSeparator
— TypeColumnSeparator(fmt, header)
Simple separator between columns, that by default simply prints a pipe.