Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make @showprogress support keyword arguments #262

Merged
merged 1 commit into from Aug 4, 2023

Conversation

dhanak
Copy link
Contributor

@dhanak dhanak commented Mar 22, 2023

This allows constructs such as:

@showprogress "X: " color=:red for x in 1:10
    sleep(1)
end

and

@showprogress showspeed=true for x in 1:10
    sleep(1)
end

Fixes #229.

Copy link

@kleinschmidt kleinschmidt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this! has been on my mind for a while 😁

It also (I think) should allow run-time disabling of progress with enabled=false kwarg.

I do think it needs tests to make sure that there aren't any wacky edge cases with for instance kwargs and positional args interleaved.

@kleinschmidt
Copy link

It also (I think) should allow run-time disabling of progress with enabled=false kwarg.

Ha I see now that that was the original feature request!

This allows constructs such as:

```
@showprogress "X: " color=:red for x in 1:10
    sleep(1)
end
```

and

```
@showprogress showspeed=true for x in 1:10
    sleep(1)
end
```
@dhanak
Copy link
Contributor Author

dhanak commented Apr 13, 2023

I added some tests.

Copy link
Owner

@timholy timholy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Somehow the tests didn't run, I'll close and reopen.

@timholy timholy closed this Aug 4, 2023
@timholy timholy reopened this Aug 4, 2023
@codecov
Copy link

codecov bot commented Aug 4, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: +1.03% 🎉

Comparison is base (9ebe384) 95.53% compared to head (5477723) 96.56%.
Report is 5 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #262      +/-   ##
==========================================
+ Coverage   95.53%   96.56%   +1.03%     
==========================================
  Files           1        1              
  Lines         515      524       +9     
==========================================
+ Hits          492      506      +14     
+ Misses         23       18       -5     
Files Changed Coverage Δ
src/ProgressMeter.jl 96.56% <100.00%> (+1.03%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@timholy timholy merged commit 469c900 into timholy:master Aug 4, 2023
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enabled keyword for macro @showprogress
3 participants