JuliaLogging / ProgressLogging.jl

MIT License
50 stars 8 forks source link

Convergence Logging #32

Open mileslucas opened 4 years ago

mileslucas commented 4 years ago

Fixes #27

Here's what I've got started in terms of convergence logging. I'd really like this feature and want to help get it done. Unfortunately, I have extremely little macro knowledge so I haven't dived into that. I would fully appreciate contributions to this regard.

This design is basically what @tkf wrote out in this comment. I've mimicked some of the code for the Progress struct and can get the following behavior:

julia> using ProgressLogging: Convergence, Ascending, Descending
julia> using UUIDs: UUID
julia> print(Convergence(UUID(1); values=[12, 13], thresholds=[5, 5]))
Convergence: 12.0|5.0
Convergence: 13.0|5.0

julia> print(Convergence(UUID(1); values=[12, 13], thresholds=[5, 5], directions=fill(Ascending, 2), step=4))
4 Convergence: 12.0↑5.0
4 Convergence: 13.0↑5.0

julia> print(Convergence(UUID(1); values=[12, 13], thresholds=[5, 5], directions=fill(Descending, 2)))
Convergence: 12.0↓5.0
Convergence: 13.0↓5.0

julia> print(Convergence(UUID(1); values=[12, 13]))
Convergence: 12.0|??
Convergence: 13.0|??

julia> print(Convergence(UUID(1); names=["A", "B"]))
A: ??|??
B: ??|??
codecov-commenter commented 4 years ago

Codecov Report

Merging #32 into master will decrease coverage by 9.35%. The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #32      +/-   ##
==========================================
- Coverage   69.04%   59.69%   -9.36%     
==========================================
  Files           1        2       +1     
  Lines         168      196      +28     
==========================================
+ Hits          116      117       +1     
- Misses         52       79      +27     
Impacted Files Coverage Δ
src/ProgressLogging.jl 69.23% <ø> (+0.18%) :arrow_up:
src/convergence.jl 0.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 10208bc...0408558. Read the comment docs.