ProgressMeter.jl icon indicating copy to clipboard operation
ProgressMeter.jl copied to clipboard

Add default spinner collection

Open alicedb2 opened this issue 1 year ago • 1 comments

I like spinners with my ProgressUnknown(), so here's a collection of 110 of them. The first 89 are stolen (with credits) from https://github.com/briandowns/spinner, the rest (90-110) I had fun creating last evening.

Summary of the changes (see below for a demo):

  • Includes a spinnercollection of 110 spinners,
  • Added the possibility of specifying spinners that are AbstractVector{<:AbstractString}. Were there any reason to restrict them to a single Char?
  • next!(prog, spinner=idx) is equivalent to next!(prog, spinner=spinnercollection[idx])
  • There's a fun demospinners() function that shows them all in action, but also
    • demospinners(idx) to look at a specific spinner in the collection,
    • demospinners(string), demospinners(vector_of_chars), and demospinners(vector_of_strings) to look at your own custom spinner,
    • demospinners(vector_of_vectors_of_strings) to look at your own set of custom spinners in a nicely aligned table. demospinners() is just demospinners(spinnercollection).
    • It adds IterTools.jl as an additional dependency because of zip_longest. I wish I could do without it, the alignment algo is very inefficient anyway and should be improved.

I don't know if anyone is interested, but if so then I'm looking for input on how to make the code align better with the organiziation/idioms of ProgressMeter.jl. Maybe we could also shrink the collection a bit and be more selective about which spinners to include.

Demo (the gif doesn't loop perfectly like the spinners in the demo do for obvious reasons, the LCM of all spinner lengths is 27,003,936,960): spinners

and so you can get things like this progressunknown

alicedb2 avatar Nov 08 '23 19:11 alicedb2

Codecov Report

Attention: 35 lines in your changes are missing coverage. Please review.

Comparison is base (5b3bd1d) 96.81% compared to head (fa0746a) 90.12%.

:exclamation: Current head fa0746a differs from pull request most recent head eaaa4a6. Consider uploading reports for the commit eaaa4a6 to get more accurate results

Files Patch % Lines
src/spinners.jl 0.00% 34 Missing :warning:
src/ProgressMeter.jl 75.00% 1 Missing :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #282      +/-   ##
==========================================
- Coverage   96.81%   90.12%   -6.69%     
==========================================
  Files           1        2       +1     
  Lines         533      567      +34     
==========================================
- Hits          516      511       -5     
- Misses         17       56      +39     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Nov 10 '23 10:11 codecov[bot]