gwpy / gwsumm

Gravitational-wave interferometer summary information system
GNU General Public License v3.0
12 stars 23 forks source link

Properly handle empty dictionary in get_range_spectrogram #407

Closed iaraota closed 5 months ago

iaraota commented 5 months ago

This PR addresses the bug introduced in #403 by acknowledging that globalv.SPECTROGRAMS might not contain the specified key. In such cases, it now correctly returns an empty SpectrogramList(), according to the previously removed code snippet:

return globalv.SPECTROGRAMS.get(key, SpectrogramList())
codecov[bot] commented 5 months ago

Codecov Report

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

Project coverage is 49.54%. Comparing base (720bd0c) to head (6233e7a). Report is 4 commits behind head on master.

Files Patch % Lines
gwsumm/data/range.py 0.00% 12 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #407 +/- ## ========================================== - Coverage 49.64% 49.54% -0.10% ========================================== Files 60 60 Lines 8823 8831 +8 ========================================== - Hits 4380 4375 -5 - Misses 4443 4456 +13 ``` | [Flag](https://app.codecov.io/gh/gwpy/gwsumm/pull/407/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=gwpy) | Coverage Δ | | |---|---|---| | [Linux](https://app.codecov.io/gh/gwpy/gwsumm/pull/407/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=gwpy) | `49.54% <0.00%> (-0.10%)` | :arrow_down: | | [macOS](https://app.codecov.io/gh/gwpy/gwsumm/pull/407/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=gwpy) | `49.54% <0.00%> (?)` | | | [python3.10](https://app.codecov.io/gh/gwpy/gwsumm/pull/407/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=gwpy) | `49.54% <0.00%> (-0.10%)` | :arrow_down: | | [python3.11](https://app.codecov.io/gh/gwpy/gwsumm/pull/407/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=gwpy) | `49.54% <0.00%> (-0.10%)` | :arrow_down: | | [python3.9](https://app.codecov.io/gh/gwpy/gwsumm/pull/407/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=gwpy) | `49.54% <0.00%> (-0.10%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=gwpy#carryforward-flags-in-the-pull-request-comment) to find out more.

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