spacetelescope / poppy

Physical Optics Propagation in Python
https://poppy-optics.readthedocs.io
BSD 3-Clause "New" or "Revised" License
211 stars 69 forks source link

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

Closed mperrin closed 4 months ago

mperrin commented 7 months ago

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.

codecov[bot] commented 7 months ago

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.

:exclamation: 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 :warning:
Additional details and impacted files ```diff @@ 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 ```

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

mperrin commented 4 months ago

@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 commented 4 months ago

@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 commented 4 months ago

@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..."