From 7bcac6cf7e66e23b30106e1dffcb62ac32082085 Mon Sep 17 00:00:00 2001 From: radek_poleski Date: Fri, 16 Jun 2023 06:16:47 +0200 Subject: [PATCH] bug in plotting negative errorbars corrected --- source/MulensModel/mulensdata.py | 7 +++++++ source/MulensModel/version.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/source/MulensModel/mulensdata.py b/source/MulensModel/mulensdata.py index ec064967..7da1ef88 100644 --- a/source/MulensModel/mulensdata.py +++ b/source/MulensModel/mulensdata.py @@ -443,9 +443,16 @@ def _plot_datapoints( y_bad = y_value[self.bad] if show_errorbars: + if np.any(y_err[self.good] < 0.): + warnings.warn("Cannot plot errorbars with negative values.") + return container = self._plt_errorbar(time_good, y_good, y_err[self.good], properties) if show_bad: + if np.any(y_err[self.bad] < 0.): + warnings.warn("Cannot plot errorbars with negative " + "values (bad data).") + return if not ('color' in properties_bad or 'c' in properties_bad): properties_bad['color'] = container[0].get_color() diff --git a/source/MulensModel/version.py b/source/MulensModel/version.py index d3270b5d..ab9fae39 100644 --- a/source/MulensModel/version.py +++ b/source/MulensModel/version.py @@ -1 +1 @@ -__version__ = "2.16.4" +__version__ = "2.16.5"