On Sun, Oct 19, 2014 at 4:57 PM, Stefan Schwarzer <sschwar...@sschwarzer.net
> wrote:

>
>
> According to
>
> http://www.ctcms.nist.gov/fipy/documentation/USAGE.html#running-under-python-3
> you should also run `2to3 --write --doctests_only`. Maybe
> that makes the difference? :-)
>

Oh yeah. That works better. Thanks.



> I gave it a try and installed Anaconda3. When running
> `python setup.py install`, I still have/had some issues.
>
> For one, a few files have mixed indentation (mixed spaces
> and tabs) which Python 3 doesn't like:
>
>   Sorry: TabError: inconsistent use of tabs and spaces in indentation
> (testBase.py, line 47)
>   Sorry: TabError: inconsistent use of tabs and spaces in indentation
> (trilinosSolver.py, line 148)
>   Sorry: TabError: inconsistent use of tabs and spaces in indentation
> (gistVectorViewer.py, line 70)
>

I've never seen that before when installing with Python 3 in Anaconda.
Which version of FiPy are you using?


>
> After fixing the files, I got that far:
>
>   The required module(s) ['pysparse'] cannot be loaded.
>   FiPy will not work properly until these modules are installed.
>   ------
>   The optional module(s) ['gist', 'mayavi'] cannot be loaded.
>   FiPy will have improved capabilities if these modules are installed.
>
> It seems `pysparse` is only available for Python 2. Is this
> correct? Is it indeed needed?
>

You don't need PySparse. It isn't available for Python 3 yet. The Scipy
solvers are adequate to get started. None of the solvers are required
packages, but you obviously need one of them.



>
> `gist` presumably is installed though:
>
>   (diffusion)schwa@warpy:~/sd/python/diffusion/FiPy-3.1$
> ~/sd/anaconda3/bin/pip install gist
>   Requirement already satisfied (use --upgrade to upgrade): gist in
> /home/schwa/sd/anaconda3/lib/python3.4/site-packages
>   Requirement already satisfied (use --upgrade to upgrade): requests in
> /home/schwa/sd/anaconda3/lib/python3.4/site-packages (from gist)
>   Requirement already satisfied (use --upgrade to upgrade): argparse in
> /home/schwa/sd/anaconda3/lib/python3.4/site-packages (from gist)
>   Cleaning up...
>   (diffusion)schwa@warpy:~/sd/python/diffusion/FiPy-3.1$
> ~/sd/anaconda3/bin/pip install --upgrade gist
>   Requirement already up-to-date: gist in
> /home/schwa/sd/anaconda3/lib/python3.4/site-packages
>   Requirement already up-to-date: requests in
> /home/schwa/sd/anaconda3/lib/python3.4/site-packages (from gist)
>   Requirement already up-to-date: argparse in
> /home/schwa/sd/anaconda3/lib/python3.4/site-packages (from gist)
>   Cleaning up...
>
> But I still get the message about the missing `gist` (see
> above).
>

Gist is a very old package that we need to remove from the dependencies.
It's a viewer. You don't actually need any of the viewers to use FiPy.
However to see stuff interactively while the simulation is running, it is
good to have one of them. I would suggest using Matplotlib to get started.
Mayavi is just optional.


> >>/site-packages/ez_setup.py",
> >> line 116, in _build_egg
> >>       raise IOError('Could not build the egg.')
> >>   OSError: Could not build the egg.
> >
> > Could it be permission issues? Just speculation.
>
> Maybe. Also just speculation. ;-) But I don't get these
> messages anymore with Anaconda.
>

Great.


>
> >>   In [3]: len(dir(fipy))
> >>   Out[3]: 144
> >
> > If you're in the fipy directory then that's not surprising.
>
> Kind of. ;-) Still the import might have failed if some
> things needed to be built but weren't. So it's not as
> "natural" as one would expect. That said, you know more
> about FiPy than me :-) ; is FiPy pure Python (apart from its
> dependencies) and is supposed to run without any
> installation other than copying the directory/file structure
> one to one?
>

It is pure Python so an installation is exactly as you describe.


>
> >> When running `fipy.test()` from within the interpreter, the
> >> summary output is
> >>
> >>   Ran 343 tests in 9.262s
> >>
> >>   FAILED (failures=7)
> >>
> >>
> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
> >>   Skipped 105 doctest examples because `gmsh` cannot be found on the
> $PATH
> >>   Skipped 20 doctest examples because neither `lsmlib` nor `skfmm` can
> be
> >> found on the $PATH
> >>   Skipped 1 doctest examples because `skfmm` must be used to run some
> tests
> >>   Skipped 83 doctest examples because the `tvtk` package cannot be
> imported
> >>
> >>
> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
> >>   An exception has occurred, use %tb to see the full traceback.
>
> Now I get the same message (when running FiPy installed in
> the environment, not from the unpacked FiPy directory).
>

I think things are working.


  (diffusion)schwa@warpy:~/sd/python/diffusion/FiPy-3.1$ python
> examples/diffusion/variable.py
>   Traceback (most recent call last):
>     File "examples/diffusion/variable.py", line 86, in <module>
>       exec(fipy.tests.doctestPlus._getScript())
>     File "<string>", line 8, in <module>
>     File
> "/home/schwa/sd/anaconda3/envs/diffusion/lib/python3.4/site-packages/FiPy-3.1-py3.4.egg/fipy/viewers/__init__.py",
> line 136, in Viewer
>       raise ImportError("Failed to import a viewer: %s" % str(errors))
>   ImportError: Failed to import a viewer: ["gnuplot: __call__() missing 1
> required positional argument: 'func'", "gist: __call__() missing 1 required
> positional argument: 'func'", "matplotlib: ufunc 'isfinite' not supported
> for the input types, and the inputs could not be safely coerced to any
> supported types according to the casting rule ''safe''", "mayavi: No module
> named 'enthought'"]
>
>   (diffusion)schwa@warpy:~/sd/python/diffusion/FiPy-3.1$ python
> examples/diffusion/coupled.py
>
> /home/schwa/sd/anaconda3/envs/diffusion/lib/python3.4/site-packages/FiPy-3.1-py3.4.egg/fipy/viewers/matplotlibViewer/__init__.py:113:
> UserWarning: Matplotlib1DViewer efficiency is improved by setting the
> 'datamax' and 'datamin' keys
>     return Matplotlib1DViewer(vars=vars, title=title, axes=axes,
> **kwlimits)
>   finished
>
> Again, no viewer opens here.
>

I'll have to look into those issues. At least the example is mostly working.


>
> By the way, when I execute the code from
>
> http://www.ctcms.nist.gov/fipy/fipy/generated/fipy.viewers.matplotlibViewer.html#matplotlibviewer-package
> up to and including the `viewer1 = MatplotlibViewer(...)`
> call and
>
>   >>> viewer = MultiViewer(viewers=(viewer1,))
>   >>> for kval in range(10):
>   ...   k.setValue(kval)
>   ...   viewer.plot()
>
> I get several diagram plotted in the top left figure. So it
> seems that Matplotlib is working in this environment. Also
> it seems to cooperate with FiPy.
>

That's good at least. There are certianly some rough edges with FiPy and
Python 3 that we need to address.

Good luck.



-- 
Daniel Wheeler
_______________________________________________
fipy mailing list
fipy@nist.gov
http://www.ctcms.nist.gov/fipy
  [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]

Reply via email to