MBravoS / splotch

Simple PLOTs, Contours and Histograms is a small package with wrapper functions designed to simplify plotting calls from matplotlib.
BSD 3-Clause "New" or "Revised" License
5 stars 0 forks source link

Raising errors in functions #15

Closed MBravoS closed 4 years ago

MBravoS commented 5 years ago

While usually when plotting fails the error raised by numpy/scipy/matplotlib is understandable, there are cases in which is not, and we should raise errors to cover those cases.

As an example, passing an list of length 0 to either x or y in plots_1d.plot() raises the following error: _File "\path\to\splotch\plots1d.py", line 445, in plot if plabel[0] is not None IndexError: list index out of range