pints
pints copied to clipboard
Matplotlib error on testing
Matplotlib looks like it has now added error checking for the value of alpha
(which controls the transparency of plots) as I now get the following types of error when running the unit tests on Github.
ERROR: test_series (test_plot.TestPlot)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/runner/work/pints/pints/pints/tests/test_plot.py", line 416, in test_series
pints.plot.series(few_samples, self.problem, thinning=1)
File "/home/runner/work/pints/pints/pints/plot/_series.py", line 110, in series
plt.plot(times, v, color='#1f77b4', alpha=alpha)
File "/opt/hostedtoolcache/Python/3.8.8/x64/lib/python3.8/site-packages/matplotlib/pyplot.py", line 2988, in plot
return gca().plot(
File "/opt/hostedtoolcache/Python/3.8.8/x64/lib/python3.8/site-packages/matplotlib/axes/_axes.py", line 1605, in plot
lines = [*self._get_lines(*args, data=data, **kwargs)]
File "/opt/hostedtoolcache/Python/3.8.8/x64/lib/python3.8/site-packages/matplotlib/axes/_base.py", line 315, in __call__
yield from self._plot_args(this, kwargs)
File "/opt/hostedtoolcache/Python/3.8.8/x64/lib/python3.8/site-packages/matplotlib/axes/_base.py", line 539, in _plot_args
return [l[0] for l in result]
File "/opt/hostedtoolcache/Python/3.8.8/x64/lib/python3.8/site-packages/matplotlib/axes/_base.py", line 539, in <listcomp>
return [l[0] for l in result]
File "/opt/hostedtoolcache/Python/3.8.8/x64/lib/python3.8/site-packages/matplotlib/axes/_base.py", line 532, in <genexpr>
result = (make_artist(x[:, j % ncx], y[:, j % ncy], kw,
File "/opt/hostedtoolcache/Python/3.8.8/x64/lib/python3.8/site-packages/matplotlib/axes/_base.py", line 354, in _makeline
seg = mlines.Line2D(x, y, **kw)
File "/opt/hostedtoolcache/Python/3.8.8/x64/lib/python3.8/site-packages/matplotlib/lines.py", line 397, in __init__
self.update(kwargs)
File "/opt/hostedtoolcache/Python/3.8.8/x64/lib/python3.8/site-packages/matplotlib/artist.py", line 1064, in update
ret.append(func(v))
File "/opt/hostedtoolcache/Python/3.8.8/x64/lib/python3.8/site-packages/matplotlib/artist.py", line 965, in set_alpha
raise ValueError(f'alpha ({alpha}) is outside 0-1 range')
ValueError: alpha (5.0) is outside 0-1 range