Deprecate Expression as base class for Python classes in favour of UserExpression

Issue #934 resolved
Prof Garth Wells created an issue

The Python code for Expression is extremely complicated because it does too many things. See #883 and https://bitbucket.org/fenics-project/dolfin/pull-requests/265.

To simplify the code, in the new pybind11 interface user-defined sub-classes of dolfin::Expression implemented in Python should be subclasses of UserExpression rather than Expression, i.e.

class MyExpreession(Expression):
    pass

becomes

class MyExpreession(UserExpression):
    pass

Add an alias to next release (UserExpression = Expression) and a add a deprecation warning that the base class needs to be changed.

Comments (5)

  1. Prof Garth Wells reporter

    I think a deprecation mechanism for this is a bit complicated in SWIG. Probably best handled via a the 2018.1 release notes.

  2. Log in to comment