usnistgov / mass

Microcalorimeter pulse-analysis software
MIT License
6 stars 0 forks source link

Fix all warnings in the test suite #289

Closed joefowler closed 3 months ago

joefowler commented 3 months ago

There are 4 warnings emitted by the test suite, including two about a deprecated behavior in Matplotlib. Fix that problem, and either fix or make the others be ignored.

=============================== warnings summary ===============================
mass/off/channels.py:99
mass/off/channels.py:99
mass/off/channels.py:99
mass/off/channels.py:99
mass/off/channels.py:99
  /home/runner/work/mass/mass/mass/off/channels.py:99: MatplotlibDeprecationWarning: Passing label as a length 8 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.
    axis.plot(x, y, drawstyle="steps-mid", label=states)
tests/core/test_oldstyletooffstyle.py::test_oldstyletooffstyle
  /home/runner/work/mass/mass/mass/off/channels.py:99: MatplotlibDeprecationWarning: Passing label as a length 2 sequence when plotting a single dataset is deprecated in Matplotlib 3.9 and will error in 3.11.  To keep the current behavior, cast the sequence to string before passing.
    axis.plot(x, y, drawstyle="steps-mid", label=states)
tests/off/test_5lag_off.py::test_off_5lag_with_saving_and_loading_recipes
  /opt/hostedtoolcache/Python/3.12.3/x64/lib/python3.12/site-packages/numpy/core/fromnumeric.py:3504: RuntimeWarning: Mean of empty slice.
    return _methods._mean(a, axis=axis, dtype=dtype,
tests/off/test_5lag_off.py::test_off_5lag_with_saving_and_loading_recipes
  /opt/hostedtoolcache/Python/3.12.3/x64/lib/python3.12/site-packages/numpy/core/_methods.py:129: RuntimeWarning: invalid value encountered in divide
    ret = ret.dtype.type(ret / rcount)