Hi FiPy Devs,
This is just a heads up that a couple of the tests are failing under
numpy 1.3.0 (I believe everything worked in 1.2.x).
Below, is one of the 2 failures from ``python setup.py test``
%. . . . . . . . . . . . . . . . . . . . Partial
Traceback . . . . . . . . . . . . . . . . . . . .
----------------------------------------------------------------------
File "/Users/Tony/python/FiPy/trunk/fipy/variables/variable.py", line
1123, in fipy.variables.variable.Variable.__or__
Failed example:
numerix.equal((a == 0) | (b == 1), [True, True, False,
True]).all()
Expected:
1
Got:
(equal(((Variable(value=array([0, 0, 1, 1])) == 0) |
(Variable(value=array([0, 1, 0, 1])) == 1)), [ True True False
True])).all(axis = axis, out = out)
%. . . . . . . . . . . . . . . . . . . . Partial
Traceback . . . . . . . . . . . . . . . . . . . .
Here's a patch correcting the problem--- just for illustration
purposes (i.e., I'm not suggesting this patch be applied since it
would probably break the tests under numpy 1.2.x):
%. . . . . . . . . . . . . . . . . . . . SVN
Diff . . . . . . . . . . . . . . . . . . . .
Index: fipy/variables/variable.py
===================================================================
--- fipy/variables/variable.py (revision 3041)
+++ fipy/variables/variable.py (working copy)
@@ -1107,7 +1107,7 @@
>>> from fipy.variables.cellVariable import CellVariable
>>> a = CellVariable(value=(0, 0, 1, 1), mesh=mesh)
>>> b = CellVariable(value=(0, 1, 0, 1), mesh=mesh)
- >>> numerix.equal((a == 0) & (b == 1), [False, True,
False, False]).all()
+ >>> numerix.equal((a() == 0) & (b() == 1), [False, True,
False, False]).all()
1
>>> print a & b
[0 0 0 1]
@@ -1130,7 +1130,7 @@
>>> from fipy.variables.cellVariable import CellVariable
>>> a = CellVariable(value=(0, 0, 1, 1), mesh=mesh)
>>> b = CellVariable(value=(0, 1, 0, 1), mesh=mesh)
- >>> numerix.equal((a == 0) | (b == 1), [True, True,
False, True]).all()
+ >>> numerix.equal((a() == 0) | (b() == 1), [True, True,
False, True]).all()
1
>>> print a | b
[0 1 1 1]
%. . . . . . . . . . . . . . . . . . . . SVN
Diff . . . . . . . . . . . . . . . . . . . .
There seems to be a difference in how CellVariable and Variable are
evaluated in comparison operations. Similar tests using Variable work
fine.
I just thought I'd let you guys know.
Best,
-Tony
P.S. Strangely, when executing fipy/variables/variable.py directly
(instead of using ``python setup.py test``) many more test failures
showed up.