Re: [matplotlib-devel] numerix.nan?
Travis E. Oliphant wrote: > I think a numpy-ism crept into the code-base (not that I particularly > mind as I will welcome the day matplotlib jettisons it's 3-array support). So will I! I don't have John's saintly patience, although I understand his rationale. My error in this case was failing to test a change I made with all three packages, although I try to do that whenever I think there might be a problem. > > In quiver.py, nx.nan is attempted, which raises an error, unless I'm > missing the definition of nan somewhere. Well, it was working at least with the version of numpy I had when I made the change in quiver to use nan internally as a mechanism for supporting masked array input. I have updated to svn, and it works with your change of course, so all is well. I added nan definitions for Numeric and numarray which work on my linux box, but I have not tested them on other platforms; I guess in the worst case, if it doesn't work on Mac or Windows I will have to change quiver.py to use masked arrays internally instead of nans. (The definition I used is "nan = float('nan')".) I used nan here because it considerably simplifies the code, now that nan is supported in the primary backends. Eric - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
Re: [matplotlib-devel] numerix.nan?
Eric Firing wrote: > I added nan definitions for > Numeric and numarray which work on my linux box, but I have not tested > them on other platforms; I guess in the worst case, if it doesn't work > on Mac or Windows I will have to change quiver.py to use masked arrays > internally instead of nans. (The definition I used is "nan = > float('nan')".) That will certainly not work on Windows. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
Re: [matplotlib-devel] numerix.nan?
Robert Kern wrote: > Eric Firing wrote: > >> I added nan definitions for >>Numeric and numarray which work on my linux box, but I have not tested >>them on other platforms; I guess in the worst case, if it doesn't work >>on Mac or Windows I will have to change quiver.py to use masked arrays >>internally instead of nans. (The definition I used is "nan = >>float('nan')".) > > > That will certainly not work on Windows. > Thanks for the quick info. I think the following (now in svn) should be OK; it seems to work on Windows, at least in the sense that it doesn't trigger an exception. nan = struct.unpack('d', struct.pack('Q', 0x7ff8))[0] Eric - Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV ___ Matplotlib-devel mailing list Matplotlib-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-devel