Beginner's errors with runTests.py

Hi everyone! I'm a quantum chemist who would like to learn about FEM analysis, and Ondrej pointed me to this package and this group.
I'm running on Mac OS X, and I've built numpy 1.1.0 and scipy-0.6.0 from source. I installed the sfepy-release-00.41.03 that was available from mac.softpedia.
When I try to run ./runTests.py --debug, I get the following:
test instance prepared (2 test(s)) +++ test_structAdd: ok +++ test_structIAdd: ok all passed in 0.00 s <<< tests/test_elasticity_small_strain.py sfe: warning: other missing: ['equations', 'functions', 'modules', 'epbc_[0-9]+|epbcs', 'lcbc_[0-9]+|lcbcs', 'nbc_[0-9]+|nbcs', 'options'] sfe: warning: left over: ['allYourBases', 'fileName_meshes', 'getPars', 'equations_general', 'equations_iso', 'TestCommon'] test instance prepared (2 test(s)) [('test_get_solution', <bound method Test.test_get_solution of Test>), ('test_linear_terms', <bound method Test.test_linear_terms of Test>)] <type 'exceptions.AttributeError'> Traceback (most recent call last): File "./runTests.py", line 222, in <module> main() File "./runTests.py", line 217, in main op.walk( options.testDir, wrapRunTests( options ), stats ) File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
$ ./runTests.py --debug <<< directory: tests, test files: 18 <<< tests/test_base.py sfe: warning: other missing: ['fileName_mesh', 'field_[0-9]+|fields', 'ebc_[0-9]+|ebcs', 'fe', 'equations', 'region_[0-9]+|regions', 'variable_[0-9]+|variables', 'material_[0-9]+|materials', 'integral_[0-9]+|integrals', 'solver_[0-9]+|solvers', 'functions', 'modules', 'epbc_[0-9]+|epbcs', 'lcbc_[0-9]+|lcbcs', 'nbc_[0-9]+| nbcs', 'options'] sfe: warning: left over: ['TestCommon'] python2.5/posixpath.py", line 290, in walk func(arg, top, names) File "./runTests.py", line 148, in runTests nFail, nTotal, testTime = runTest( confName, options ) File "./runTests.py", line 111, in runTest ok, nFail, nTotal = test.run( options.debug ) File "/Users/rmuller/Python/sfepy/sfepy-release-00.41.03/sfe/base/ testing.py", line 38, in run ret = testMethod() File "tests/test_elasticity_small_strain.py", line 156, in test_get_solution from sfe.solvers.generic import solveStationary File "/Users/rmuller/Python/sfepy/sfepy-release-00.41.03/sfe/solvers/ __init__.py", line 3, in <module> from ls import * File "/Users/rmuller/Python/sfepy/sfepy-release-00.41.03/sfe/solvers/ ls.py", line 6, in <module> import scipy.linsolve.umfpack as um AttributeError: 'module' object has no attribute 'umfpack'
Trying to dig a little deeper, I see that in my version of scipy I can successfully import scipy.linsolve.umfpack:
import scipy.linsolve.umfpack
but when I try to install umfpack *as* something, I run into problems:
import scipy.linsolve.umfpack as um Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'module' object has no attribute 'umfpack'
Any suggestsions? Or is this a bug that should be taken up with the scipy-users list?

Hi Rick!
On Sat, Jul 19, 2008 at 1:56 PM, rpmu...@gmail.com <rpmu...@gmail.com> wrote:
Hi everyone! I'm a quantum chemist who would like to learn about FEM analysis, and Ondrej pointed me to this package and this group.
I'm running on Mac OS X, and I've built numpy 1.1.0 and scipy-0.6.0 from source. I installed the sfepy-release-00.41.03 that was available from mac.softpedia.
When I try to run ./runTests.py --debug, I get the following:
test instance prepared (2 test(s)) +++ test_structAdd: ok +++ test_structIAdd: ok all passed in 0.00 s <<< tests/test_elasticity_small_strain.py sfe: warning: other missing: ['equations', 'functions', 'modules', 'epbc_[0-9]+|epbcs', 'lcbc_[0-9]+|lcbcs', 'nbc_[0-9]+|nbcs', 'options'] sfe: warning: left over: ['allYourBases', 'fileName_meshes', 'getPars', 'equations_general', 'equations_iso', 'TestCommon'] test instance prepared (2 test(s)) [('test_get_solution', <bound method Test.test_get_solution of Test>), ('test_linear_terms', <bound method Test.test_linear_terms of Test>)] <type 'exceptions.AttributeError'> Traceback (most recent call last): File "./runTests.py", line 222, in <module>
$ ./runTests.py --debug <<< directory: tests, test files: 18 <<< tests/test_base.py sfe: warning: other missing: ['fileName_mesh', 'field_[0-9]+|fields', 'ebc_[0-9]+|ebcs', 'fe', 'equations', 'region_[0-9]+|regions', 'variable_[0-9]+|variables', 'material_[0-9]+|materials', 'integral_[0-9]+|integrals', 'solver_[0-9]+|solvers', 'functions', 'modules', 'epbc_[0-9]+|epbcs', 'lcbc_[0-9]+|lcbcs', 'nbc_[0-9]+| nbcs', 'options'] sfe: warning: left over: ['TestCommon'] main() File "./runTests.py", line 217, in main op.walk( options.testDir, wrapRunTests( options ), stats ) File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ python2.5/posixpath.py", line 290, in walk func(arg, top, names) File "./runTests.py", line 148, in runTests nFail, nTotal, testTime = runTest( confName, options ) File "./runTests.py", line 111, in runTest ok, nFail, nTotal = test.run( options.debug ) File "/Users/rmuller/Python/sfepy/sfepy-release-00.41.03/sfe/base/ testing.py", line 38, in run ret = testMethod() File "tests/test_elasticity_small_strain.py", line 156, in test_get_solution from sfe.solvers.generic import solveStationary File "/Users/rmuller/Python/sfepy/sfepy-release-00.41.03/sfe/solvers/ __init__.py", line 3, in <module> from ls import * File "/Users/rmuller/Python/sfepy/sfepy-release-00.41.03/sfe/solvers/ ls.py", line 6, in <module> import scipy.linsolve.umfpack as um AttributeError: 'module' object has no attribute 'umfpack'
Trying to dig a little deeper, I see that in my version of scipy I can successfully import scipy.linsolve.umfpack:
import scipy.linsolve.umfpack
but when I try to install umfpack *as* something, I run into problems:
import scipy.linsolve.umfpack as um Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'module' object has no attribute 'umfpack'
Any suggestsions? Or is this a bug that should be taken up with the scipy-users list?
Unfortunately, Robert will be available on Monday, but this problem is a scipy problem. You can ask on scipy-users list, but I can try to fix it as well.
I have:
In [1]: import scipy
In [2]: scipy.version.version Out[2]: '0.6.0'
In [3]: import scipy.linsolve.umfpack as um
In [4]:
so this works for me.
When you were installing scipy, do you have umfpack installed? SciPy needs to be compiled with it.
E.g. do you have
/usr/lib/python2.5/site-packages/scipy/linsolve/umfpack/__umfpack.so
? (It should be in some similar path on mac)
I have experience with Debian/Ubuntu and Robert with gentoo. We don't use Mac OS X, but a lot of people on scipy-users do, so they may help as well.
Ondrej

When you were installing scipy, do you have umfpack installed? SciPy needs to be compiled with it.
E.g. do you have
/usr/lib/python2.5/site-packages/scipy/linsolve/umfpack/__umfpack.so
? (It should be in some similar path on mac)
I have experience with Debian/Ubuntu and Robert with gentoo. We don't use Mac OS X, but a lot of people on scipy-users do, so they may help as well.
Just installed UMFPack, and rebuild scipy from scratch, but something is going wrong in the build, and, although I have the directory:
$ ls /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/ site-packages/scipy/linsolve/umfpack/ __init__.py _umfpack.py info.pyc tests/ __init__.pyc _umfpack.pyc setup.py umfpack.py __umfpack.so info.py setup.pyc umfpack.pyc
For some reason I can't import it:
s886301{rmuller}[1]: import scipy.linsolve.umfpack as um
AttributeError Traceback (most recent call last)
/Users/rmuller/<ipython console> in <module>()
AttributeError: 'module' object has no attribute 'umfpack'
However, I'll pursue this on scipy-users. Thanks for your help.

On Sun, Jul 20, 2008 at 8:16 PM, rpmu...@gmail.com <rpmu...@gmail.com> wrote:
When you were installing scipy, do you have umfpack installed? SciPy needs to be compiled with it.
E.g. do you have
/usr/lib/python2.5/site-packages/scipy/linsolve/umfpack/__umfpack.so
? (It should be in some similar path on mac)
I have experience with Debian/Ubuntu and Robert with gentoo. We don't use Mac OS X, but a lot of people on scipy-users do, so they may help as well.
Just installed UMFPack, and rebuild scipy from scratch, but something is going wrong in the build, and, although I have the directory:
$ ls /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/ site-packages/scipy/linsolve/umfpack/ __init__.py _umfpack.py info.pyc tests/ __init__.pyc _umfpack.pyc setup.py umfpack.py __umfpack.so info.py setup.pyc umfpack.pyc
For some reason I can't import it:
s886301{rmuller}[1]: import scipy.linsolve.umfpack as um
AttributeError Traceback (most recent call last)
/Users/rmuller/<ipython console> in <module>()
AttributeError: 'module' object has no attribute 'umfpack'
However, I'll pursue this on scipy-users. Thanks for your help.
Hm, could you try:
In [1]: import scipy.linsolve
In [2]: dir(scipy.linsolve) Out[2]: ['NumpyTest', '__all__', '__builtins__', '__doc__', '__file__', '__name__', '__path__', '_csuperlu', '_dsuperlu', '_ssuperlu', '_superlu', '_zsuperlu', 'asarray', 'factorized', 'isUmfpack', 'isspmatrix', 'isspmatrix_csc', 'isspmatrix_csr', 'linsolve', 'spdiags', 'splu', 'spsolve', 'test', 'umfpack', 'useUmfpack', 'use_solver']
In [3]: scipy.linsolve.isUmfpack Out[3]: True
The umfpack doesn't seem to be imported. See also scipy/linsolve/__init__.py and scipy/linsolve/umfpack/__init__.py
Ondrej

Hi Rick, welcome to the list!
rpmu...@gmail.com wrote:
Hi everyone! I'm a quantum chemist who would like to learn about FEM analysis, and Ondrej pointed me to this package and this group.
I'm running on Mac OS X, and I've built numpy 1.1.0 and scipy-0.6.0 from source. I installed the sfepy-release-00.41.03 that was available from mac.softpedia.
Unfortunately none of us (right?) has a Mac, so you are a poineer in this area. I will, of course, try to answer all your issues, so ask, please.
When I try to run ./runTests.py --debug, I get the following:
test instance prepared (2 test(s)) +++ test_structAdd: ok +++ test_structIAdd: ok all passed in 0.00 s <<< tests/test_elasticity_small_strain.py sfe: warning: other missing: ['equations', 'functions', 'modules', 'epbc_[0-9]+|epbcs', 'lcbc_[0-9]+|lcbcs', 'nbc_[0-9]+|nbcs', 'options'] sfe: warning: left over: ['allYourBases', 'fileName_meshes', 'getPars', 'equations_general', 'equations_iso', 'TestCommon'] test instance prepared (2 test(s)) [('test_get_solution', <bound method Test.test_get_solution of Test>), ('test_linear_terms', <bound method Test.test_linear_terms of Test>)] <type 'exceptions.AttributeError'> Traceback (most recent call last): File "./runTests.py", line 222, in <module> main() File "./runTests.py", line 217, in main op.walk( options.testDir, wrapRunTests( options ), stats ) File "/Library/Frameworks/Python.framework/Versions/2.5/lib/
$ ./runTests.py --debug <<< directory: tests, test files: 18 <<< tests/test_base.py sfe: warning: other missing: ['fileName_mesh', 'field_[0-9]+|fields', 'ebc_[0-9]+|ebcs', 'fe', 'equations', 'region_[0-9]+|regions', 'variable_[0-9]+|variables', 'material_[0-9]+|materials', 'integral_[0-9]+|integrals', 'solver_[0-9]+|solvers', 'functions', 'modules', 'epbc_[0-9]+|epbcs', 'lcbc_[0-9]+|lcbcs', 'nbc_[0-9]+| nbcs', 'options'] sfe: warning: left over: ['TestCommon'] python2.5/posixpath.py", line 290, in walk func(arg, top, names) File "./runTests.py", line 148, in runTests nFail, nTotal, testTime = runTest( confName, options ) File "./runTests.py", line 111, in runTest ok, nFail, nTotal = test.run( options.debug ) File "/Users/rmuller/Python/sfepy/sfepy-release-00.41.03/sfe/base/ testing.py", line 38, in run ret = testMethod() File "tests/test_elasticity_small_strain.py", line 156, in test_get_solution from sfe.solvers.generic import solveStationary File "/Users/rmuller/Python/sfepy/sfepy-release-00.41.03/sfe/solvers/ __init__.py", line 3, in <module> from ls import * File "/Users/rmuller/Python/sfepy/sfepy-release-00.41.03/sfe/solvers/ ls.py", line 6, in <module> import scipy.linsolve.umfpack as um AttributeError: 'module' object has no attribute 'umfpack'
Trying to dig a little deeper, I see that in my version of scipy I can successfully import scipy.linsolve.umfpack:
import scipy.linsolve.umfpack
but when I try to install umfpack *as* something, I run into problems:
import scipy.linsolve.umfpack as um Traceback (most recent call last): File "<stdin>", line 1, in <module> AttributeError: 'module' object has no attribute 'umfpack'
Any suggestsions? Or is this a bug that should be taken up with the scipy-users list?
It is an umfpack installation issue, as Ondrej has pointed out.
I have read your messages at scipy-users and it seems that you have some path problems. Do you have any updates on this? What if you manually add the umfpack directory to your sys.path?
r.

On Jul 21, 3:24 am, Robert Cimrman <cimr...@ntc.zcu.cz> wrote:
It is an umfpack installation issue, as Ondrej has pointed out.
I have read your messages at scipy-users and it seems that you have some path problems. Do you have any updates on this? What if you manually add the umfpack directory to your sys.path?
r.
Update: I now get the same errors on the Mac and on RHEL4.
I don't know whether they're path features or not. The umfpack libraries are static (.a) rather than dynamic (.so) libraries, which normally means you don't have to worry about path, right?
Thus far I haven't gotten any replies on the scipy lists, so I'm still waiting on both platforms.

On Mon, Jul 21, 2008 at 7:19 PM, rpmu...@gmail.com <rpmu...@gmail.com> wrote:
On Jul 21, 3:24 am, Robert Cimrman <cimr...@ntc.zcu.cz> wrote:
It is an umfpack installation issue, as Ondrej has pointed out.
I have read your messages at scipy-users and it seems that you have some path problems. Do you have any updates on this? What if you manually add the umfpack directory to your sys.path?
r.
Update: I now get the same errors on the Mac and on RHEL4.
I don't know whether they're path features or not. The umfpack libraries are static (.a) rather than dynamic (.so) libraries, which normally means you don't have to worry about path, right?
On Debian, the umfpack is an .so package: /usr/lib/libumfpack.so.3.1.0
Thus far I haven't gotten any replies on the scipy lists, so I'm still waiting on both platforms.
I am sorry for these problems. The umfpack is needed though. Doesn't RHEL have a scipy package already build with umpack?
All these things makes me happy I chose Debian for all my computers, it just works.
Ondrej

Ondrej Certik wrote:
On Mon, Jul 21, 2008 at 7:19 PM, rpmu...@gmail.com <rpmu...@gmail.com> wrote:
On Jul 21, 3:24 am, Robert Cimrman <cimr...@ntc.zcu.cz> wrote:
It is an umfpack installation issue, as Ondrej has pointed out.
I have read your messages at scipy-users and it seems that you have some path problems. Do you have any updates on this? What if you manually add the umfpack directory to your sys.path?
r. Update: I now get the same errors on the Mac and on RHEL4.
I don't know whether they're path features or not. The umfpack libraries are static (.a) rather than dynamic (.so) libraries, which normally means you don't have to worry about path, right?
On Debian, the umfpack is an .so package: /usr/lib/libumfpack.so.3.1.0
The python extension modules must be dynamic .so libraries. This may be the problem... See http://www.python.org/doc/ext/compilation.html
The umfpack library can be static though, you just have to have something like scipy/sparse/linalg/dsolve/umfpack/__umfpack.so in your scipy installation, i.e. the umfpack wrappers I wrote for scipy, and the .a lib must be linked to it. The exact path depends on your scipy version, the newest is to have umfpack module as a scikit.
Have a look at http://projects.scipy.org/pipermail/scipy-user/2008-February/015500.html See also http://www.scipy.org/Installing_SciPy/Linux, maybe it helps.
Thus far I haven't gotten any replies on the scipy lists, so I'm still waiting on both platforms.
I am sorry for these problems. The umfpack is needed though. Doesn't RHEL have a scipy package already build with umpack?
All these things makes me happy I chose Debian for all my computers, it just works.
Same on gentoo.
The problem is that umfpack is the default solver in sfepy, as it can solve any system (symmetric positive definite or completely general, as far as it is not singular) that fits in memory and is very fast.
You can play with the code without it, but the other interfaced solvers (e.g. iterative solvers shipped with SciPy) are not so robust and one usually must do some preconditioning.
For example, a Poisson equation can be solved very fast with
solver_0 = { 'name' : 'ls', 'kind' : 'ls.scipy_iterative',
'method' : 'cg',
'i_max' : 1000,
'eps_a' : 1e-12,
}
instead of the default
solver_0 = { 'name' : 'ls', 'kind' : 'ls.umfpack', }
r.

Quick update...
Thanks for all the support. I just installed Ubuntu 8.04 on a Parallels virtual machine, and sfepy appears to run out of the box in that configuration. I'm still figuring out what to do now, and I'll start by looking at what Ondrej has already done in schrodinger.py.
But the good news is that I can use sfepy!
Rick
On Jul 22, 3:36 am, Robert Cimrman <cimr...@ntc.zcu.cz> wrote:
Ondrej Certik wrote:
On Mon, Jul 21, 2008 at 7:19 PM, rpmu...@gmail.com <rpmu...@gmail.com> wrote:
On Jul 21, 3:24 am, Robert Cimrman <cimr...@ntc.zcu.cz> wrote:
It is an umfpack installation issue, as Ondrej has pointed out.
I have read your messages at scipy-users and it seems that you have some path problems. Do you have any updates on this? What if you manually add the umfpack directory to your sys.path?
r. Update: I now get the same errors on the Mac and on RHEL4.
I don't know whether they're path features or not. The umfpack libraries are static (.a) rather than dynamic (.so) libraries, which normally means you don't have to worry about path, right?
On Debian, the umfpack is an .so package: /usr/lib/libumfpack.so.3.1.0
The python extension modules must be dynamic .so libraries. This may be the problem... Seehttp://www.python.org/doc/ext/compilation.html
The umfpack library can be static though, you just have to have something like scipy/sparse/linalg/dsolve/umfpack/__umfpack.so in your scipy installation, i.e. the umfpack wrappers I wrote for scipy, and the .a lib must be linked to it. The exact path depends on your scipy version, the newest is to have umfpack module as a scikit.
Have a look athttp://projects.scipy.org/pipermail/scipy-user/2008-February/015500.html See alsohttp://www.scipy.org/Installing_SciPy/Linux, maybe it helps.
Thus far I haven't gotten any replies on the scipy lists, so I'm still waiting on both platforms.
I am sorry for these problems. The umfpack is needed though. Doesn't RHEL have a scipy package already build with umpack?
All these things makes me happy I chose Debian for all my computers, it just works.
Same on gentoo.
The problem is that umfpack is the default solver in sfepy, as it can solve any system (symmetric positive definite or completely general, as far as it is not singular) that fits in memory and is very fast.
You can play with the code without it, but the other interfaced solvers (e.g. iterative solvers shipped with SciPy) are not so robust and one usually must do some preconditioning.
For example, a Poisson equation can be solved very fast with
solver_0 = { 'name' : 'ls', 'kind' : 'ls.scipy_iterative',
'method' : 'cg', 'i_max' : 1000, 'eps_a' : 1e-12,
}
instead of the default
solver_0 = { 'name' : 'ls', 'kind' : 'ls.umfpack',
}
r.

Hi Rick,
Quoting "rpmu...@gmail.com" <rpmu...@gmail.com>:
Quick update...
Thanks for all the support. I just installed Ubuntu 8.04 on a Parallels virtual machine, and sfepy appears to run out of the box in that configuration. I'm still figuring out what to do now, and I'll start by looking at what Ondrej has already done in schrodinger.py.
But the good news is that I can use sfepy!
Great, just ask if you stumble upon some problems. Ondrej will surely
answer schrodinger.py and physics related ones and I will take care of
the rest.
If you have some updates concerning running sfepy in your original
configuration, tell us - we will put it somewhere on our wiki.
r.
participants (3)
-
Ondrej Certik
-
Robert Cimrman
-
rpmu...@gmail.com