From 71a02f009a7d0a07a66eafc2797353ec91684e84 Mon Sep 17 00:00:00 2001 From: Adam Kulidjian Date: Wed, 3 Oct 2018 17:38:51 -0400 Subject: [PATCH 1/2] ignore divide error in streamline --- plotly/figure_factory/_streamline.py | 1 + 1 file changed, 1 insertion(+) diff --git a/plotly/figure_factory/_streamline.py b/plotly/figure_factory/_streamline.py index ddc14778c43..89ff8719a77 100644 --- a/plotly/figure_factory/_streamline.py +++ b/plotly/figure_factory/_streamline.py @@ -354,6 +354,7 @@ def get_streamline_arrows(self): dif_x = arrow_end_x - arrow_start_x dif_y = arrow_end_y - arrow_start_y + np.seterr(divide='ignore', invalid='ignore') streamline_ang = np.arctan(dif_y / dif_x) ang1 = streamline_ang + (self.angle) From 0d17600cc7a2f92598c89b10d4508fb369759087 Mon Sep 17 00:00:00 2001 From: Adam Kulidjian Date: Thu, 4 Oct 2018 11:41:20 -0400 Subject: [PATCH 2/2] revert np error to original after division --- plotly/figure_factory/_streamline.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plotly/figure_factory/_streamline.py b/plotly/figure_factory/_streamline.py index 89ff8719a77..a6773420f48 100644 --- a/plotly/figure_factory/_streamline.py +++ b/plotly/figure_factory/_streamline.py @@ -354,8 +354,11 @@ def get_streamline_arrows(self): dif_x = arrow_end_x - arrow_start_x dif_y = arrow_end_y - arrow_start_y + orig_err = np.geterr() np.seterr(divide='ignore', invalid='ignore') streamline_ang = np.arctan(dif_y / dif_x) + np.seterr(**orig_err) + ang1 = streamline_ang + (self.angle) ang2 = streamline_ang - (self.angle)