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

Allow forcing the progress bar update #315

Merged
merged 1 commit into from
Jul 13, 2024
Merged

Conversation

alyst
Copy link
Contributor

@alyst alyst commented Jun 25, 2024

The PR adds the force=true/false keyword argument to updateProgress!() method.
When force=true, the progress bar is unconditionally updated regardless the too frequent bar updates check.

The use case: I am processing the big data file that I download chunk by chunk (one chunk contains thousands of data entries).
The progress bar reflects how many entries have been processed.
Each datum is processed within fraction of a second.
However, downloading the next chunk of data takes a while (minutes), during which time the progress bar freezes.
I use showvalues= to report the current status: either data processing or chunk download.
The problem is that in 99.9% cases the download-related progress bar update gets suppressed by the frequency filter (dt) -- so during the download the bar incorrectly reports that data entries are being processed.
So with this PR I can make sure that the bar would be updated just before the download by passing force=true.

Copy link

codecov bot commented Jun 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.77%. Comparing base (807496a) to head (221e735).
Report is 14 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #315      +/-   ##
==========================================
+ Coverage   93.48%   96.77%   +3.29%     
==========================================
  Files           1        1              
  Lines         399      558     +159     
==========================================
+ Hits          373      540     +167     
+ Misses         26       18       -8     

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

@MarcMush
Copy link
Collaborator

Does dt=0 not work in this case?

@alyst
Copy link
Contributor Author

alyst commented Jun 25, 2024

Does dt=0 not work in this case?

It should definitely update the bar at each step, but that's not what I want:
I have ~10^8 fast steps and ~20 slow steps, and dt logic is perfectly fine for the small steps to avoid flooding the terminal.
I only want to make sure that the bar is updated for each slow step.

@MarcMush
Copy link
Collaborator

MarcMush commented Jul 8, 2024

indeed it makes sense
I thought update!(p;dt=0) would work but it doesn't

@MarcMush MarcMush merged commit cf6a596 into timholy:master Jul 13, 2024
26 checks passed
@alyst alyst deleted the force_update branch July 13, 2024 19:43
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.

2 participants