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

Add optional progress bar display during PSF and datacube calculations #605

Merged

Conversation

mperrin
Copy link
Collaborator

@mperrin mperrin commented Jan 17, 2024

Minor. Adds a progressbar bool parameter for displaying a progress bar for status during long PSF or datacube calculations using the optical system calc_psf or instrument class calc_datacube functions.

Requires optional dependency tqdm, which I have intentionally not made a required dependency as part of this PR, since this is an optional feature for a cosmetic display during calculations, not otherwise used anywhere within poppy.

@mperrin mperrin self-assigned this Jan 17, 2024
@mperrin mperrin added the enhancement New feature or request label Jan 17, 2024
Copy link

codecov bot commented Jan 17, 2024

Codecov Report

Attention: Patch coverage is 85.71429% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 74.45%. Comparing base (87c3318) to head (67ec1e0).
Report is 1 commits behind head on develop.

❗ Current head 67ec1e0 differs from pull request most recent head f77dfdd. Consider uploading reports for the commit f77dfdd to get more accurate results

Files Patch % Lines
poppy/utils.py 77.77% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #605      +/-   ##
===========================================
+ Coverage    74.44%   74.45%   +0.01%     
===========================================
  Files           18       18              
  Lines         6645     6656      +11     
===========================================
+ Hits          4947     4956       +9     
- Misses        1698     1700       +2     

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

@mperrin mperrin changed the title Add optional progress bar display during datacube calculations Add optional progress bar display during PSF and datacube calculations Mar 7, 2024
@mperrin mperrin force-pushed the calc_datacube_progressbar branch from ef7f9e9 to 67ec1e0 Compare March 27, 2024 14:25
@mperrin
Copy link
Collaborator Author

mperrin commented Apr 26, 2024

@obi-wan76 @BradleySappington Good morning, I realized I never tagged anyone to review this PR from some months ago. This adds a minor 'quality of life' improvement to optionally display progress bars during long calculations. Hopefully straightforward for one of you to review, thanks.

@mperrin mperrin force-pushed the calc_datacube_progressbar branch from 67ec1e0 to f77dfdd Compare April 26, 2024 15:29
Copy link
Collaborator

@BradleySappington BradleySappington left a comment

Choose a reason for hiding this comment

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

I haven't used tqdm before, what an elegant solution! Nice work

@BradleySappington BradleySappington merged commit c7dab74 into spacetelescope:develop Apr 29, 2024
7 checks passed
@mperrin
Copy link
Collaborator Author

mperrin commented Apr 29, 2024

@BradleySappington yeah tqdm is quite nice. It makes it super easy to add a progress bar to any for loop or other iteration. The actual progress bar display part of this PR is tiny and succinct compared to the extra contortions I put in to make it optional and configurable with a function parameter. 😆

@BradleySappington
Copy link
Collaborator

@BradleySappington yeah tqdm is quite nice. It makes it super easy to add a progress bar to any for loop or other iteration. The actual progress bar display part of this PR is tiny and succinct compared to the extra contortions I put in to make it optional and configurable with a function parameter. 😆

@mperrin Lol, such is the way, "Yes, this works so easy!....now work for me..."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants