File tree Expand file tree Collapse file tree 2 files changed +12
-9
lines changed
tests/unit/test_expression_tree Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -76,22 +76,24 @@ def test_to_equation(self):
7676 self .assertEqual (func .to_equation (), sympy .Symbol ("test" ))
7777
7878 # Test Arcsinh
79- self .assertEqual (pybamm .Arcsinh (a ).to_equation (), sympy .asinh (a ))
79+ self .assertEqual (pybamm .Arcsinh (a ).to_equation (), sympy .asinh ("a" ))
8080
8181 # Test Arctan
82- self .assertEqual (pybamm .Arctan (a ).to_equation (), sympy .atan (a ))
82+ self .assertEqual (pybamm .Arctan (a ).to_equation (), sympy .atan ("a" ))
8383
8484 # Test Exp
85- self .assertEqual (pybamm .Exp (a ).to_equation (), sympy .exp (a ))
85+ self .assertEqual (pybamm .Exp (a ).to_equation (), sympy .exp ("a" ))
8686
8787 # Test log
88- self .assertEqual (pybamm .Log (54.0 ).to_equation (), sympy .log (54.0 ))
88+ value = 54.0
89+ self .assertEqual (pybamm .Log (value ).to_equation (), sympy .log (value ))
8990
9091 # Test sinh
91- self .assertEqual (pybamm .Sinh (a ).to_equation (), sympy .sinh (a ))
92+ self .assertEqual (pybamm .Sinh (a ).to_equation (), sympy .sinh ("a" ))
9293
9394 # Test Function
94- self .assertEqual (pybamm .Function (np .log , 10 ).to_equation (), 10.0 )
95+ value = 10
96+ self .assertEqual (pybamm .Function (np .log , value ).to_equation (), value )
9597
9698 def test_to_from_json_error (self ):
9799 a = pybamm .Symbol ("a" )
Original file line number Diff line number Diff line change @@ -699,18 +699,19 @@ def test_to_equation(self):
699699 self .assertEqual (pybamm .Floor (- 2.5 ).to_equation (), sympy .Symbol ("test" ))
700700
701701 # Test Negate
702- self .assertEqual (pybamm .Negate (4 ).to_equation (), - 4.0 )
702+ value = 4
703+ self .assertEqual (pybamm .Negate (value ).to_equation (), - value )
703704
704705 # Test AbsoluteValue
705- self .assertEqual (pybamm .AbsoluteValue (- 4 ).to_equation (), 4.0 )
706+ self .assertEqual (pybamm .AbsoluteValue (- value ).to_equation (), value )
706707
707708 # Test Gradient
708709 self .assertEqual (pybamm .Gradient (a ).to_equation (), sympy_Gradient ("a" ))
709710
710711 # Test Divergence
711712 self .assertEqual (
712713 pybamm .Divergence (pybamm .Gradient (a )).to_equation (),
713- sympy_Divergence (sympy_Gradient (a )),
714+ sympy_Divergence (sympy_Gradient ("a" )),
714715 )
715716
716717 # Test BoundaryValue
You can’t perform that action at this time.
0 commit comments