Skip to content

Commit f77d9e2

Browse files
authored
Don't use SymPDE's obsolete classes Scalar/VectorField (#9)
* Do not import obsolete classes ScalarField and VectorField from SymPDE - they were not used anyway; * Update version.
1 parent ded25c7 commit f77d9e2

File tree

3 files changed

+11
-17
lines changed

3 files changed

+11
-17
lines changed

gelato/expr.py

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
# coding: utf-8
22

3-
from sympy import Function
4-
from sympy.core import Add, Mul
53
from sympy import I as sympy_I
64
from sympy import Symbol
75
from sympy.core.containers import Tuple
86
from sympy import S
9-
from sympy.core import Expr, Basic, AtomicExpr
7+
from sympy.core import Expr, Basic
108
from sympy import simplify, expand
11-
from sympy import Matrix, ImmutableDenseMatrix
12-
from sympy.physics.quantum import TensorProduct
139

14-
from sympde.expr import LinearForm, BilinearForm
10+
from sympde.expr import BilinearForm
1511
from sympde.expr import TensorExpr
1612

1713
from sympde.expr import Mass as MassForm
@@ -22,12 +18,12 @@
2218
from sympde.expr import Basic1dForm
2319
from sympde.topology import SymbolicExpr
2420
from sympde.calculus.matrices import SymbolicDeterminant
25-
from sympde.topology.space import ScalarField, VectorField
2621

27-
from .glt import (BasicGlt, Mass, Stiffness,
28-
Advection, Bilaplacian)
22+
from .glt import (BasicGlt, Mass, Stiffness, Advection, Bilaplacian)
2923

24+
__all__ = ('gelatize', 'GltExpr')
3025

26+
#==============================================================================
3127
def gelatize(a, degrees=None, n_elements=None, evaluate=False, mapping=None,
3228
human=False, expand=False):
3329

@@ -130,8 +126,6 @@ def gelatize(a, degrees=None, n_elements=None, evaluate=False, mapping=None,
130126

131127
return expr
132128

133-
134-
135129
#==============================================================================
136130
# TODO add __call__
137131
class GltExpr(Expr):

gelato/tests/test_glt_symbol.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# coding: utf-8
22

33
from sympy.core import Symbol
4-
from sympy import cos, sin
4+
from sympy import cos, sin, Rational as frac
55

66
from gelato import Mass, Stiffness, Advection, Bilaplacian
77

@@ -15,22 +15,22 @@ def test_glt_symbol_1():
1515
three = 3
1616

1717
# ... linear splines
18-
assert( Mass(one, t) == cos(t)/3 + 2/3 )
18+
assert( Mass(one, t) == cos(t)/3 + frac(2, 3) )
1919
assert( Stiffness(one, t) == -2*cos(t) + 2 )
2020
assert( Advection(one, t) == -sin(t) )
2121
# assert( Bilaplacian(one, t) == 0 )
2222
# ...
2323

2424
# ... quadratic splines
25-
assert( Mass(two, t) == 13*cos(t)/30 + cos(2*t)/60 + 11/20 )
25+
assert( Mass(two, t) == 13*cos(t)/30 + cos(2*t)/60 + frac(11, 20) )
2626
assert( Stiffness(two, t) == -2*cos(t)/3 - cos(2*t)/3 + 1 )
2727
assert( Advection(two, t) == -5*sin(t)/6 - sin(2*t)/12 )
2828
# assert( Bilaplacian(two, t) == -8*cos(t) + 2*cos(2*t) + 6 )
2929
# ...
3030

3131
# ... cubic splines
32-
assert( Mass(three, t) == 397*cos(t)/840 + cos(2*t)/21 + cos(3*t)/2520 + 151/315 )
33-
assert( Stiffness(three, t) == -cos(t)/4 - 2*cos(2*t)/5 - cos(3*t)/60 + 2/3)
32+
assert( Mass(three, t) == 397*cos(t)/840 + cos(2*t)/21 + cos(3*t)/2520 + frac(151, 315) )
33+
assert( Stiffness(three, t) == -cos(t)/4 - 2*cos(2*t)/5 - cos(3*t)/60 + frac(2, 3))
3434
assert( Advection(three, t) == -49*sin(t)/72 - 7*sin(2*t)/45 - sin(3*t)/360 )
3535
# assert( Bilaplacian(three, t) == -3*cos(t) + cos(3*t)/3 + 8/3 )
3636
# ...

gelato/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = '0.10.0'
1+
__version__ = '0.11.0'

0 commit comments

Comments
 (0)