Le Tue, 12 Mar 2013 12:26:43 -0400,
Adrian Jacobo <[email protected]> a écrit :
> Hi,
>
> I think there is a bug somewhere (may be Matplotlib was updated?).
> If I run the mesh20x20.py or mesh1d.py examples FiPy opens a
> Matplotlib viewer without a problem. When running circle.py it fails
> to open a Matplotlib viewer (and that is why it defaults to the
> Mayavi viewer). I modified the circle.py example to explicitly open a
> Matplotlib viewer, and it produces the following error:
>
> Traceback (most recent call last):
> File "mycircle.py", line 57, in <module>
> viewer = MatplotlibViewer(vars=phi, datamin=-1, datamax=1.)
> File
> "/Users/ajacobo/Work/Python/FiPy-3.0/fipy/viewers/matplotlibViewer/__init__.py",
>
> line 119, in MatplotlibViewer
> return Matplotlib2DViewer(vars=vars, title=title, cmap=cmap,
> colorbar=colorbar, axes=axes, **kwlimits)
> File
> "/Users/ajacobo/Work/Python/FiPy-3.0/fipy/viewers/matplotlibViewer/matplotlib2DViewer.py",
>
> line 90, in __init__
> **kwlimits)
> File
> "/Users/ajacobo/Work/Python/FiPy-3.0/fipy/viewers/matplotlibViewer/matplotlibViewer.py",
>
> line 90, in __init__
> w, h = pylab.figaspect(self.figaspect(figaspect))
> File
> "/Users/ajacobo/Work/Python/FiPy-3.0/fipy/viewers/matplotlibViewer/matplotlib2DViewer.py",
>
> line 48, in figaspect
> figaspect = self.vars[0].mesh.aspect2D
> File
> "/Users/ajacobo/Work/Python/FiPy-3.0/fipy/meshes/abstractMesh.py",
> line 1410, in aspect2D
> xCoords = numerix.take(self.vertexCoords[0], vertexIDs)
> File "/Users/ajacobo/Work/Python/FiPy-3.0/fipy/tools/numerix.py",
> line 601, in take
> taken = MA.take(a, MA.filled(indices, 0), axis=axis)
> File "/usr/local/lib/python2.7/site-packages/numpy/ma/core.py",
> line 5986, in take
> return a.take(indices, axis=axis, out=out, mode=mode)
> File "/usr/local/lib/python2.7/site-packages/numpy/ma/core.py",
> line 5231, in take
> out = _data.take(indices, axis=axis, mode=mode).view(cls)
> TypeError: Cannot cast array data from dtype('float64') to
> dtype('int64') according to the rule 'safe'
>
> I send you attached a copy of the script. The wierdest thing is
> that if I save the variable phi to a file and then reopen the file
> and display it, it opens a Matplotlib viewer without problems.
> Speaking of which, do I need to do something special if I want
> to save a variable when running in parallel? I'm unable so save the
> variable to a file and then open it in a serial script for viewing
> (the viewing script starts filling up all the available memory, and
> crashes).
>
> Thank you so much for all your help! sorry to bother you with so many
> questions!
>
> Adrian.
>
>
> > On Tue, Mar 12, 2013 at 10:16 AM, Adrian Jacobo
> > <[email protected]
> > <mailto:[email protected]>> wrote:
> >
> > Hi,
> >
> > Thanks for your help. I gave up trying to make Trilinos work
> > with my macports installation and ended up installing everything
> > with homebrew,
> > following the guide on the wiki (there are a few hicups along
> > the way because some things don't work right away in Mountain Lion,
> > but nothing
> > critical).
> > I've noticed something with this new installation. When I ran
> > the diffusion.circle example using my previous installation the FiPy
> > opened
> > a matplotlib viewer, and now with the homebrew based
> > installation it opens a Mayavi viewer. Is this normal?
> >
> >
> > It should open a Matplotlib viewer by default unless it isn't
> > available.
> >
> > how does FiPy determine which
> > kind of viewer to use?
> >
> >
> > See this
> > http://www.ctcms.nist.gov/fipy/documentation/USAGE.html#envvar-FIPY_VIEWER.
> > Set "FIPY_VIEWER" to "matplotlib" or "mayavi" and it should take
> > care of it. You can also instantiate the viewers directly, see the
> > viewers at http://matforge.org/fipy/browser/fipy/fipy/viewers.
> >
> > Cheers
> >
> > --
> > Daniel Wheeler
> >
> >
> > _______________________________________________
> > fipy mailing list
> > [email protected]
> > http://www.ctcms.nist.gov/fipy
> > [ NIST internal ONLY:
> > https://email.nist.gov/mailman/listinfo/fipy ]
>
Have a look to my previous email about numpy 1.7 bug !!!
--
Philippe BAUCOUR
=========================================
Institut FEMTO-ST, Dept. ENERGIE
Parc technologique, 2 avenue Jean Moulin
90000 Belfort, France
Tel : +33 (0)3.84.57.82.15
Fax : +33 (0)3.84.57.00.32
=========================================
FCLAB
Bâtiment F, Rue Thierry Mieg
90010 Belfort Cedex, France
Tél : +33 (0)3 84 58 36 42
Fax : +33 (0)3 84 58 36 36
_______________________________________________
fipy mailing list
[email protected]
http://www.ctcms.nist.gov/fipy
[ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]