From 9d09407e55eaf5880e02ccb9f67c65b09837a8c2 Mon Sep 17 00:00:00 2001 From: Chengyu Liu Date: Mon, 8 May 2023 17:12:10 +0900 Subject: [PATCH 1/2] MAINT: fix the function interpretation for scalar_image_function_inspector.py --- .../examples/demo/advanced/scalar_image_function_inspector.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chaco/examples/demo/advanced/scalar_image_function_inspector.py b/chaco/examples/demo/advanced/scalar_image_function_inspector.py index b91a519bd..8f20c3cf8 100644 --- a/chaco/examples/demo/advanced/scalar_image_function_inspector.py +++ b/chaco/examples/demo/advanced/scalar_image_function_inspector.py @@ -130,8 +130,8 @@ def compute_model(self): x, y = meshgrid(gridx, gridy) d = dict(x=x, y=y) - exec("from scipy import *", d) - exec("from scipy.special import *", d) + exec("from scipy import tanh, cos", d) + exec("from scipy.special import jn", d) try: self.zs = eval(self.function, d) except NameError: From 3e27a239d6aa82011ae6b85662b6e786f3ce6656 Mon Sep 17 00:00:00 2001 From: Corran Webster Date: Mon, 15 May 2023 14:26:39 +0100 Subject: [PATCH 2/2] Apply suggestions from code review --- .../examples/demo/advanced/scalar_image_function_inspector.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/chaco/examples/demo/advanced/scalar_image_function_inspector.py b/chaco/examples/demo/advanced/scalar_image_function_inspector.py index 8f20c3cf8..f498ecddf 100644 --- a/chaco/examples/demo/advanced/scalar_image_function_inspector.py +++ b/chaco/examples/demo/advanced/scalar_image_function_inspector.py @@ -130,8 +130,8 @@ def compute_model(self): x, y = meshgrid(gridx, gridy) d = dict(x=x, y=y) - exec("from scipy import tanh, cos", d) - exec("from scipy.special import jn", d) + exec("from numpy import *", d) + exec("from scipy.special import *", d) try: self.zs = eval(self.function, d) except NameError: