gwpy / gwsumm

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

Bugfix for empty trigger tables #396

Closed eagoetz closed 7 months ago

eagoetz commented 7 months ago

This PR fixes the empty table where we want to extend the columns. There was a bug when using extend('foo'). It should be extend(['foo']).

codecov[bot] commented 7 months ago

Codecov Report

Attention: 2 lines in your changes are missing coverage. Please review.

Comparison is base (21b3e62) 49.64% compared to head (76c39fd) 49.64%.

Files Patch % Lines
gwsumm/triggers.py 0.00% 2 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #396 +/- ## ======================================= Coverage 49.64% 49.64% ======================================= Files 60 60 Lines 8823 8823 ======================================= Hits 4380 4380 Misses 4443 4443 ``` | [Flag](https://app.codecov.io/gh/gwpy/gwsumm/pull/396/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/396/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=gwpy) | `49.64% <0.00%> (ø)` | | | [python3.10](https://app.codecov.io/gh/gwpy/gwsumm/pull/396/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=gwpy) | `49.64% <0.00%> (ø)` | | | [python3.11](https://app.codecov.io/gh/gwpy/gwsumm/pull/396/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=gwpy) | `49.64% <0.00%> (ø)` | | | [python3.9](https://app.codecov.io/gh/gwpy/gwsumm/pull/396/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=gwpy) | `49.64% <0.00%> (ø)` | | 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.

iaraota commented 7 months ago

@eagoetz I approved the PR, but could you explain me why you are using .extend([item]) instead of .append(item)?

eagoetz commented 7 months ago

@eagoetz I approved the PR, but could you explain me why you are using .extend([item]) instead of .append(item)?

@iaraota In general, I prefer extend() over append() because, for example,

>>> foo = [1, 2]
>>> foo.append([3, 4])
>>> foo
[1, 2, [3, 4]]
>>> bar = [1, 2]
>>> bar.extend([3, 4])
>>> bar
[1, 2, 3, 4]

I agree that it's perhaps not necessary in this case, but I like this behviour better (when I don't screw it up like I did here).