From ea9acc45d5abf53705845aa15b9f88b824b22b59 Mon Sep 17 00:00:00 2001 From: Mark Dickinson Date: Thu, 4 Jul 2019 10:56:02 +0100 Subject: [PATCH 1/2] Fix two uses of the deprecated Logger.warn method. --- chaco/barplot.py | 5 +++-- chaco/errorbar_plot.py | 6 +++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/chaco/barplot.py b/chaco/barplot.py index 7470ade86..6fa8c71bd 100644 --- a/chaco/barplot.py +++ b/chaco/barplot.py @@ -230,8 +230,9 @@ def _gather_points(self): return if len(index) == 0 or len(value) == 0 or len(index) != len(value): - logger.warn("Chaco: using empty dataset; index_len=%d, value_len=%d." \ - % (len(index), len(value))) + logger.warning( + "Chaco: using empty dataset; index_len=%d, value_len=%d." + % (len(index), len(value))) self._cached_data_pts = array([]) self._cache_valid = True return diff --git a/chaco/errorbar_plot.py b/chaco/errorbar_plot.py index 056c8838e..77a59e91a 100644 --- a/chaco/errorbar_plot.py +++ b/chaco/errorbar_plot.py @@ -76,7 +76,11 @@ def _gather_points(self): l1, l2, l3 = sm.map(len, (index, value_low, value_high)) if 0 in (l1, l2, l3) or not (l1 == l2 == l3): - logger.warn("Chaco: using empty dataset; index_len=%d, value_low_len=%d, value_high_len=%d." % (l1,l2,l3)) + logger.warning( + "Chaco: using empty dataset; index_len=%d, " + "value_low_len=%d, value_high_len=%d." + % (l1,l2,l3) + ) self._cached_data_pts = [] self._cache_valid = True return From 560705cc3a630c3bfbdebf7d2ac1a8ae8112130e Mon Sep 17 00:00:00 2001 From: Mark Dickinson Date: Thu, 4 Jul 2019 10:57:43 +0100 Subject: [PATCH 2/2] Keep style consistent with surrounding code. --- chaco/errorbar_plot.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/chaco/errorbar_plot.py b/chaco/errorbar_plot.py index 77a59e91a..a4f377eb9 100644 --- a/chaco/errorbar_plot.py +++ b/chaco/errorbar_plot.py @@ -79,8 +79,7 @@ def _gather_points(self): logger.warning( "Chaco: using empty dataset; index_len=%d, " "value_low_len=%d, value_high_len=%d." - % (l1,l2,l3) - ) + % (l1,l2,l3)) self._cached_data_pts = [] self._cache_valid = True return