From febd70656689fb8e1ef4f558c4604bece632cf02 Mon Sep 17 00:00:00 2001
From: Jean-Baptiste Keck <Jean-Baptiste.Keck@imag.fr>
Date: Thu, 19 Jul 2018 15:08:56 +0200
Subject: [PATCH] fixed sympy 1.2 tuple

---
 ci/docker_images/ubuntu/bionic/Dockerfile | 11 +++++++++++
 hysop/tools/sympy_utils.py                |  3 ++-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/ci/docker_images/ubuntu/bionic/Dockerfile b/ci/docker_images/ubuntu/bionic/Dockerfile
index d8a3985a9..9a1c9f1eb 100644
--- a/ci/docker_images/ubuntu/bionic/Dockerfile
+++ b/ci/docker_images/ubuntu/bionic/Dockerfile
@@ -206,6 +206,17 @@ RUN cd /tmp                                      \
  && cd -                                         \
  && rm -Rf /tmp/pyFFTW
 
+# CUDA 9.2 for ubuntu 17.10 (if nvidia gpu is present)
+# This assumes an up to date driver is present on host 
+# while building docker file.
+RUN (lspci | grep -i vga | grep -i nvidia)
+ && apt-get update \
+ && apt install gnupg-curl
+ && dpkg --install https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1710/x86_64/cuda-repo-ubuntu1710_9.2.148-1_amd64.deb
+ && apt-key adv --fetch-key https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1710/x86_64/7fa2af80.pub
+ && apt-get update
+ && apt-get install cuda
+
 # ensure all libraries are known by the runtime linker
 RUN ldconfig
 
diff --git a/hysop/tools/sympy_utils.py b/hysop/tools/sympy_utils.py
index e35bb6914..e3813a47f 100644
--- a/hysop/tools/sympy_utils.py
+++ b/hysop/tools/sympy_utils.py
@@ -327,7 +327,8 @@ def recurse_expression_tree(op, expr):
 def get_derivative_variables(expr):
     """Derivative arguments changed for sympy 1.2"""
     assert isinstance(expr, sm.Derivative)
-    if isinstance(expr.args[1], tuple):
+    from sympy.core import containers
+    if isinstance(expr.args[1], containers.Tuple):
         # sympy >= 1.2 arguments are (variable, count)
         # args = [(x0,3), (x1,1)]
         _vars = tuple(v[0] for v in expr.args[1:] for _ in xrange(v[1]))
-- 
GitLab