Tony S Yu | 30 May 22:48

Fipy 2.0a1 with numpy 1.1

Hi,

I just installed numpy 1.1.0 and (after fixing a minor ImportError for  
masked arrays) I get 77 failures and 13 errors from FiPy's `setup.py  
test`. With my previous install (with numpy 1.0.4), I had 1 failure  
(diffusion/anisotropy.py).

Are there plans to make FiPy compatible with numpy 1.1?

I took a crack at making some fixes, but I don't understand the  
internals of FiPy (or the changes in numpy) well enough to do a good  
job. The changes I made should be backwards compatible (I wrapped  
everything in try/except blocks), but I can't actually test it with  
numpy 1.0.4 on my computer.

I've included a diff file with the changes, but the code I added may  
be a little amateurish.

-Tony

Specs:
=====
FiPy 2.0a1 revision 2542
Numpy 1.1.0 (easy_install)
OS X Leopard 10.5.3

Summary of Changes
=================
1) set take to use numpy's masked array `take` function.
	-- 47 failures and 3 errors.
(Continue reading)

Jonathan Guyer | 30 May 23:30

Re: Fipy 2.0a1 with numpy 1.1


On May 30, 2008, at 4:49 PM, Tony S Yu wrote:

> Are there plans to make FiPy compatible with numpy 1.1?

Of course, but it was only released yesterday.

> I've included a diff file with the changes, but the code I added may  
> be a little amateurish.

Thanks very much for this. We'll get your changes incorporated and the  
remainder of the problems resolved as quickly as possible.

- Jon

--

-- 
Jonathan E. Guyer, PhD
Metallurgy Division
National Institute of Standards and Technology
<http://www.metallurgy.nist.gov/>

Tony S Yu | 1 Jun 15:52

Re: Fipy 2.0a1 with numpy 1.1


On May 30, 2008, at 5:30 PM, Jonathan Guyer wrote:

>
>
> On May 30, 2008, at 4:49 PM, Tony S Yu wrote:
>
>> Are there plans to make FiPy compatible with numpy 1.1?
>
> Of course, but it was only released yesterday.

Yeah, I guess I was a little over eager :).

In any case, I just read over the release notes for numpy 1.1, and it  
turns out they support the old masked array API (this change is what  
caused most of the breakages) in the module numpy.oldnumeric.ma.  
Changing to this import statement in the fipy numerix module led to 4  
failures;  3 of which are just due to a change in representation of  
floats near integer values; for example:

Expected:
     (3-4j)
Got:
     (3.0+-4.0j)

which isn't really important (to me at least). The 4th failure is  
actually from examples/diffusion/anisotropy.py, which failed for me  
before the numpy upgrade. Should this be failing?

Also, I was able to confirm that my fixes didn't break FiPy for the  
(Continue reading)

Jonathan Guyer | 1 Jun 18:09

Re: Fipy 2.0a1 with numpy 1.1


On Jun 1, 2008, at 9:52 AM, Tony S Yu wrote:

>
> On May 30, 2008, at 5:30 PM, Jonathan Guyer wrote:
>
>>
>>
>> On May 30, 2008, at 4:49 PM, Tony S Yu wrote:
>>
>>> Are there plans to make FiPy compatible with numpy 1.1?
>>
>> Of course, but it was only released yesterday.
>
> Yeah, I guess I was a little over eager :).

Much better that than disinterested!

> In any case, I just read over the release notes for numpy 1.1, and  
> it turns out they support the old masked array API (this change is  
> what caused most of the breakages) in the module  
> numpy.oldnumeric.ma. Changing to this import statement in the fipy  
> numerix module led to 4 failures;  3 of which are just due to a  
> change in representation of floats near integer values; for example:
>
> Expected:
>   (3-4j)
> Got:
>   (3.0+-4.0j)
>
(Continue reading)

Tony S Yu | 2 Jun 02:24

Re: Fipy 2.0a1 with numpy 1.1


On Jun 1, 2008, at 12:09 PM, Jonathan Guyer wrote:
> This is great! Thank you very much. I've committed your changes in  
> r2550.
>
>
> In fipy/meshes/numMesh/mesh.py, (with the notable exception of  
> _calcFaceToCellDistances), the changes are just for readability,  
> correct?

Yes, that's correct; except for _calcFaceToCellDistances (a really  
tough bug to find btw), just readability changes.

-Tony

Jonathan Guyer | 2 Jun 20:39

Re: Fipy 2.0a1 with numpy 1.1


On Jun 1, 2008, at 8:24 PM, Tony S Yu wrote:

> except for _calcFaceToCellDistances (a really tough bug to find btw),

I'll bet. Nice catch.

p.s. Please don't comment out tests just to make them "pass". If  
they're failing, they're failing.


Gmane