SymPy 1.2 breaks diff of expression without variables

Issue #27 resolved
Fabian Löschner created an issue

Installing the most recent version of SymPy which is distributed through pip (1.2, https://github.com/sympy/sympy/wiki/Release-Notes-for-1.2) and running cd fiat/test/unit && python3 -mpytest leads to

========================================= test session starts =========================================
platform linux -- Python 3.6.5, pytest-3.6.3, py-1.5.4, pluggy-0.6.0
rootdir: /home/fabian/programming/fenics_work/main/fiat, inifile:
collected 536 items / 1 errors                                                                        
=============================================== ERRORS ================================================
_______________________________ ERROR collecting test/unit/test_fiat.py _______________________________
test_fiat.py:274: in <module>
    (Lagrange(T, 3), Bubble(T, 3)),
../../FIAT/lagrange.py:54: in __init__
    poly_set = polynomial_set.ONPolynomialSet(ref_el, degree)
../../FIAT/polynomial_set.py:174: in __init__
    dv = expansion_set.tabulate_derivatives(degree, pts)
../../FIAT/expansions.py:260: in tabulate_derivatives
    data = _tabulate_dpts(self._tabulate, 2, n, order, numpy.array(pts))
../../FIAT/expansions.py:102: in _tabulate_dpts
    phi.append(form_derivative(phi[-1]))
../../FIAT/expansions.py:48: in form_derivative
    out = [sympy.diff(F, X[j]) for j in range(D)]
../../FIAT/expansions.py:48: in <listcomp>
    out = [sympy.diff(F, X[j]) for j in range(D)]
/home/fabian/.local/lib/python3.6/site-packages/sympy/core/function.py:1993: in diff
    return Derivative(f, *symbols, **kwargs)
/home/fabian/.local/lib/python3.6/site-packages/sympy/core/function.py:1117: in __new__
    it cannot be differentiated.''' % expr))
E   ValueError: 
E   Since there are no variables in the expression [0, 0], it cannot be
E   differentiated.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 1 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
======================================= 1 error in 0.98 seconds =======================================

Comments (6)

  1. Log in to comment