From 33a7c204ce2eb763affb793245c363225241609a Mon Sep 17 00:00:00 2001 From: alfrenardi Date: Tue, 7 Apr 2015 23:41:20 +0200 Subject: [PATCH 1/2] Changed wrong test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changed “multiply” to “*” --- fipy/variables/meshVariable.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fipy/variables/meshVariable.py b/fipy/variables/meshVariable.py index 4c77f343b7..40acc6bf1e 100644 --- a/fipy/variables/meshVariable.py +++ b/fipy/variables/meshVariable.py @@ -533,10 +533,10 @@ def _shapeClassAndOther(self, opShape, operatorClass, other): >>> savedFilters = list(warnings.filters) >>> warnings.resetwarnings() >>> warnings.simplefilter("error", UserWarning, append=True) - >>> C = CellVariable(mesh=mesh) * (A * B) + >>> C = (A * B) * CellVariable(mesh=mesh) Traceback (most recent call last): ... - UserWarning: The expression `(multiply([0 1 2 3 4], Variable(value=array(1.0))))` has been cast to a constant `CellVariable` + UserWarning: The expression `(Variable(value=array(1.0)) * [0 1 2 3 4])` has been cast to a constant `CellVariable` >>> warnings.filters = savedFilters """ otherShape = numerix.getShape(other) From f650055a0e71a124a3723f16a93f9a896ccdeb10 Mon Sep 17 00:00:00 2001 From: alfrenardi Date: Tue, 7 Apr 2015 23:42:47 +0200 Subject: [PATCH 2/2] Changed wrong test --- fipy/tools/dimensions/physicalField.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/fipy/tools/dimensions/physicalField.py b/fipy/tools/dimensions/physicalField.py index c028a3fd9e..73e0579a7d 100755 --- a/fipy/tools/dimensions/physicalField.py +++ b/fipy/tools/dimensions/physicalField.py @@ -624,11 +624,8 @@ def __array_wrap__(self, arr, context=None): >>> print type(numerix.array([1.0, 2.0]) * PhysicalField([1.0, 2.0], unit="m")) - For not very intelligible reasons, the `PhysicalField`\ness gets cast - away if there are no units. Probably not harmful, so not worth investigating - - >>> print type(numerix.array([1.0, 2.0]) * PhysicalField([1.0, 2.0])) is type(numerix.array(1)) - 1 + >>> print type(numerix.array([1.0, 2.0]) * PhysicalField([1.0, 2.0])) + >>> from scipy.special import gamma as Gamma # doctest: +SCIPY >>> print type(Gamma(PhysicalField([1.0, 2.0]))) is type(numerix.array(1)) # doctest: +SCIPY