gwpy / gwsumm

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

Fix pcolormesh call in newer matplotlib versions #352

Closed eagoetz closed 1 year ago

eagoetz commented 1 year ago

Apparently this fails in recent versions of matplotlib:

ax.pcolormesh([1, 10], [1, 10], [[1, 10]], visible=False, **plotargs)

with error:

TypeError: Dimensions of C (1, 2) are incompatible with X (2) and/or Y (2); see help(pcolormesh)

It should instead be

ax.pcolormesh([1, 10], [1, 10], [[1, 10], [1, 10]], visible=False, **plotargs)
codecov[bot] commented 1 year ago

Codecov Report

Merging #352 (3ae584f) into master (d97665d) will not change coverage. The diff coverage is 0.00%.

@@           Coverage Diff           @@
##           master     #352   +/-   ##
=======================================
  Coverage   49.48%   49.48%           
=======================================
  Files          57       57           
  Lines        8429     8429           
=======================================
  Hits         4171     4171           
  Misses       4258     4258           
Flag Coverage Δ
Linux 49.48% <0.00%> (ø)
macOS ?
python3.10 49.48% <0.00%> (ø)
python3.7 48.64% <0.00%> (ø)
python3.8 49.48% <0.00%> (ø)
python3.9 49.48% <0.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
gwsumm/plot/builtin.py 21.72% <0.00%> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

duncanmmacleod commented 1 year ago

@eagoetz the change looks fine, it's unfortunate that its not covered by the test suite, is that something you can address?

eagoetz commented 1 year ago

@eagoetz the change looks fine, it's unfortunate that its not covered by the test suite, is that something you can address?

@duncanmmacleod Yeah, it was never tested in the past. It seems like the line is only hit if there was no data. I can put that together, but it will take some time for me to understand how to produce such a test. Do you want this before you approve?

Edit: following up, it looks like the coverage on this particular module is pretty low: https://app.codecov.io/gh/gwpy/gwsumm/blob/master/gwsumm/plot/builtin.py. It seems like there may not be any unit testing of this corner of gwsumm.