From fa65b2fdd12f65a03297feb39243ea6c23faa793 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Sat, 1 Jul 2017 22:06:36 +0530 Subject: [PATCH 1/3] Update symengine to 0.3.0.rc0 --- .test-conda-env-py3.yml | 2 +- sumpy/codegen.py | 3 --- sumpy/symbolic.py | 2 +- sumpy/tools.py | 6 +----- test/test_cse.py | 3 +-- 5 files changed, 4 insertions(+), 12 deletions(-) diff --git a/.test-conda-env-py3.yml b/.test-conda-env-py3.yml index f336c9e9..c62e5730 100644 --- a/.test-conda-env-py3.yml +++ b/.test-conda-env-py3.yml @@ -12,5 +12,5 @@ dependencies: - islpy - pyopencl - python=3.5 -- python-symengine=0.2.0.53.g83912b7=py35_1 +- python-symengine=0.3.0.rc0 # things not in here: loopy boxtree pymbolic pyfmmlib diff --git a/sumpy/codegen.py b/sumpy/codegen.py index ab739e4f..cb56a3c2 100644 --- a/sumpy/codegen.py +++ b/sumpy/codegen.py @@ -69,9 +69,6 @@ class SympyToPymbolicMapper(SympyToPymbolicMapperBase): return expr elif getattr(expr, "is_Function", False): func_name = SympyToPymbolicMapperBase.function_name(self, expr) - # SymEngine capitalizes the names of the special functions. - if func_name.lower() in _SPECIAL_FUNCTION_NAMES: - func_name = func_name.lower() return prim.Variable(func_name)( *tuple(self.rec(arg) for arg in expr.args)) else: diff --git a/sumpy/symbolic.py b/sumpy/symbolic.py index 85dbb278..93295bca 100644 --- a/sumpy/symbolic.py +++ b/sumpy/symbolic.py @@ -81,7 +81,7 @@ Add Basic Mul Pow exp sqrt symbols sympify cos sin atan2 Function Symbol Derivative Integer Matrix Subs I pi functions""".split() if USE_SYMENGINE: - from symengine import sympy_compat as sym + import symengine as sym from pymbolic.interop.symengine import ( PymbolicToSymEngineMapper as PymbolicToSympyMapper, SymEngineToPymbolicMapper as SympyToPymbolicMapper) diff --git a/sumpy/tools.py b/sumpy/tools.py index 56c32bf3..007b06e7 100644 --- a/sumpy/tools.py +++ b/sumpy/tools.py @@ -416,11 +416,7 @@ def my_syntactic_subs(expr, subst_dict): if new_expr != expr.expr or any(new_var != var for new_var, var in zip(new_variables, expr.variables)): - # FIXME in SymEngine - if USE_SYMENGINE: - return Derivative(new_expr, new_variables) - else: - return Derivative(new_expr, *new_variables) + return Derivative(new_expr, *new_variables) return expr diff --git a/test/test_cse.py b/test/test_cse.py index 4f957aaa..8484ee47 100644 --- a/test/test_cse.py +++ b/test/test_cse.py @@ -220,8 +220,7 @@ def test_dont_cse_derivative(): from sumpy.symbolic import Derivative f = Function("f") - # FIXME - deriv = Derivative(f(x+y), (x,)) if USE_SYMENGINE else Derivative(f(x+y), x) + deriv = Derivative(f(x+y), x) name_val, (expr,) = cse(x + y + deriv) -- GitLab From b10a0564830893151a09b57a2ba8ac317bdd78c1 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Sat, 1 Jul 2017 22:15:12 +0530 Subject: [PATCH 2/3] Remove unused import --- sumpy/tools.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sumpy/tools.py b/sumpy/tools.py index 007b06e7..f3398b9c 100644 --- a/sumpy/tools.py +++ b/sumpy/tools.py @@ -387,7 +387,7 @@ class KernelCacheWrapper(object): def my_syntactic_subs(expr, subst_dict): # Workaround for differing substitution semantics between sympy and symengine. # FIXME: This is a hack. - from sumpy.symbolic import Basic, Subs, Derivative, USE_SYMENGINE + from sumpy.symbolic import Basic, Subs, Derivative if not isinstance(expr, Basic): return expr -- GitLab From 8d77d9dd47df1a7380a2cd63b96060fececb5eab Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Thu, 6 Jul 2017 09:38:57 -0400 Subject: [PATCH 3/3] Update .test-conda-env-py3.yml --- .test-conda-env-py3.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.test-conda-env-py3.yml b/.test-conda-env-py3.yml index c62e5730..a53d2c22 100644 --- a/.test-conda-env-py3.yml +++ b/.test-conda-env-py3.yml @@ -1,7 +1,7 @@ name: test-conda-env-py3 channels: - inducer -- symengine/label/dev +- symengine - conda-forge - defaults dependencies: @@ -12,5 +12,5 @@ dependencies: - islpy - pyopencl - python=3.5 -- python-symengine=0.3.0.rc0 +- python-symengine=0.3.0 # things not in here: loopy boxtree pymbolic pyfmmlib -- GitLab