
Hi again,
I just ran ./runTests.py with the latest git and I noticed one test was failing (tests/test_input_linear_elastic.py). However, when I ran ./runTests.py --debug tests/test_input_linear_elastic.py, the test is passing. It also passes with just ./runTests.py tests/test_input_linear_elastic.py. Here's the output:
logan@phoenix:~/projects/sfepy$ ./runTests.py <<< directory: tests, test files: 36 tests/test_lcbc_3d.py
/usr/lib/python2.5/site-packages/scipy/linsolve/__init__.py:4: DeprecationWarning: scipy.linsolve has moved to scipy.sparse.linalg.dsolve warn('scipy.linsolve has moved to scipy.sparse.linalg.dsolve', DeprecationWarning) /home/logan/projects/sfepy/sfepy/fem/extmods/geometry.py:174: DeprecationWarning: PyArray_FromDims: use PyArray_SimpleNew. return _geometry.VolumeGeometry_variable(self, *args)
/home/logan/projects/sfepy/sfepy/fem/extmods/geometry.py:174: DeprecationWarning: PyArray_FromDimsAndDataAndDescr: use PyArray_NewFromDescr. return _geometry.VolumeGeometry_variable(self, *args)
+++ test_linear_rigid_body_bc: ok
tests/test_functions.py
+++ test_ebc_functions: ok
+++ test_material_functions: ok
+++ test_region_functions: ok
tests/test_assembling.py
+++ test_dq_de: ok
+++ test_surface_evaluate: ok
+++ test_vector_matrix: ok
tests/test_input_kostka.py
+++ test_input: ok
tests/test_periodic_bc_3d.py
+++ test_pbc: ok
tests/test_input_stabilized_navier_stokes.py
+++ test_input: ok
tests/test_msm_laplace.py
+++ test_msm_laplace: ok
tests/test_input_acoustics.py
+++ test_input: ok
tests/test_input_sinbc.py
+++ test_input: ok
tests/test_elasticity_small_strain.py
+++ test_get_solution: ok
+++ test_linear_terms: ok
tests/test_periodic_bc_2d.py
+++ test_pbc: ok
tests/test_meshio.py
nodes: 100%
|################################################################################################################################################################| Time: 00:00:00 elements: 100% |#############################################################################################################################################################| Time: 00:00:01 +++ test_read_meshes: ok
+++ test_compare_same_meshes: ok
+++ test_read_dimension: ok
tests/test_input_piezo.py
+++ test_ebc: ok
+++ test_input: ok
tests/test_input_le.py
+++ test_input: ok
tests/test_quadratures.py
+++ test_problem_creation: ok
tests/test_input_biot.py
+++ test_input: ok
tests/test_parsing.py
+++ test_parse_equations: ok
+++ test_parse_regions: ok
tests/test_input_time_poisson.py
/usr/lib/python2.5/site-packages/scipy/sparse/linalg/dsolve/linsolve.py:147: SparseEfficiencyWarning: splu requires CSC matrix format warn('splu requires CSC matrix format', SparseEfficiencyWarning)
+++ test_input: ok
tests/test_laplace_unit_square.py
+++ test_boundary_fluxes: ok
+++ test_solution: ok
tests/test_input_linear_elastic_dynamic.py
+++ test_input: ok
tests/test_io.py
+++ test_recursive_dict_hdf5: ok
/usr/lib/python2.5/site-packages/scipy/sparse/compressed.py:24: DeprecationWarning: dims= is deprecated, use shape= instead
warn("dims= is deprecated, use shape= instead", DeprecationWarning)
+++ test_sparse_matrix_hdf5: ok
tests/test_input_linear_elastic.py
--- test_input: failed!
tests/test_linear_solvers.py
/usr/lib/python2.5/site-packages/numpy/lib/utils.py:108: DeprecationWarning: scipy.linalg.cg is deprecated, use scipy.sparse.linalg.cg
warnings.warn(str1, DeprecationWarning)
/usr/lib/python2.5/site-packages/numpy/lib/utils.py:108: DeprecationWarning: scipy.linalg.bicgstab is deprecated, use scipy.sparse.linalg.bicgstab
warnings.warn(str1, DeprecationWarning)
/usr/lib/python2.5/site-packages/numpy/lib/utils.py:108: DeprecationWarning: scipy.linalg.qmr is deprecated, use scipy.sparse.linalg.qmr
warnings.warn(str1, DeprecationWarning)
+++ test_solvers: ok
tests/test_input_subdomains.py
+++ test_input: ok
tests/test_input_octahedron.py
nodes: 100%
|################################################################################################################################################################| Time: 00:00:00 elements: 100% |#############################################################################################################################################################| Time: 00:00:00 +++ test_input: ok
tests/test_lcbc_2d.py
+++ test_linear_rigid_body_bc: ok
tests/test_base.py
+++ test_struct_add: ok
+++ test_struct_i_add: ok
tests/test_volume.py
+++ test_volume: ok
tests/test_input_biot_npbc.py
/home/logan/projects/sfepy/sfepy/fem/extmods/geometry.py:256: DeprecationWarning: PyArray_FromDims: use PyArray_SimpleNew.
return _geometry.SurfaceGeometry_variable(self, *args)
/home/logan/projects/sfepy/sfepy/fem/extmods/geometry.py:256: DeprecationWarning: PyArray_FromDimsAndDataAndDescr: use PyArray_NewFromDescr.
return _geometry.SurfaceGeometry_variable(self, *args)
+++ test_input: ok
tests/test_msm_symbolic.py
/usr/lib/pymodules/python2.5/sympy/matrices/matrices.py:1443: UserWarning: Deprecated: use zeros() instead.
warnings.warn( 'Deprecated: use zeros() instead.' )
+++ test_msm_symbolic_diffusion: ok
+++ test_msm_symbolic_laplace: ok
tests/test_input_navier_stokes.py
+++ test_input: ok
tests/test_input_pfdpm_permeability.py
+++ test_input: ok
tests/test_term_consistency.py
+++ test_consistency_d_dw: ok
tests/test_laplace_unit_disk.py
+++ test_boundary_fluxes: ok
tests/test_input_hyperelastic.py
+++ test_input: ok
tests/test_input_poisson.py
+++ test_input: ok
36 test file(s) executed in 77.16 s, 1 failure(s) of 49 test(s)
logan@phoenix:~/projects/sfepy$ ./runTests.py --debug tests/test_input_linear_elastic.py <<< tests/test_input_linear_elastic.py
sfepy: left over: ['__builtins__', '_filename', '__file__', 'TestInput', 'input_name', '__name__', 'output_name', '__doc__'] sfepy: left over: ['_filename', '__builtins__', '__doc__', '__name__', '__file__']
test instance prepared (1 test(s))
... solving ../input/linear_elastic.py...
sfepy: reading mesh (database/simple.vtk)...
sfepy: ...done in 0.05 s
sfepy: setting up domain edges...
sfepy: ...done in 0.02 s
sfepy: setting up domain faces...
sfepy: ...done in 0.01 s
sfepy: creating regions...
sfepy: Right
sfepy: Omega
sfepy: Left
sfepy: ...done in 0.04 s
sfepy: equation "balance_of_forces":
sfepy: dw_lin_elastic_iso.i1.Omega( solid.lam, solid.mu, v, u ) = 0 sfepy: setting up dof connectivities...
sfepy: ...done in 0.00 s
sfepy: describing geometries... sfepy: ...done in 0.01 s sfepy: using solvers: nls: newton ls: ls sfepy: matrix shape: (900, 900) sfepy: assembling matrix graph... sfepy: ...done in 0.02 s sfepy: matrix structural nonzeros: 31842 (3.93e-02% fill) sfepy: updating materials... sfepy: solid sfepy: ...done in 0.00 s sfepy: updating variables... sfepy: ...done /usr/lib/python2.5/site-packages/scipy/linsolve/__init__.py:4: DeprecationWarning: scipy.linsolve has moved to scipy.sparse.linalg.dsolve warn('scipy.linsolve has moved to scipy.sparse.linalg.dsolve', DeprecationWarning) sfepy: nls: iter: 0, residual: 8.696725e-03 (rel: 1.000000e+00) sfepy: rezidual: 0.01 [s] sfepy: solve: 0.04 [s] sfepy: matrix: 0.01 [s] sfepy: nls: iter: 1, residual: 5.531265e-18 (rel: 6.360170e-16) ... ../input/linear_elastic.py solved +++ test_input: ok
all passed in 1.58 s 1 test file executed in 1.58 s, 0 failure(s) of 1 test(s) logan@phoenix:~/projects/sfepy$ ./runTests.py tests/test_input_linear_elastic.py tests/test_input_linear_elastic.py /usr/lib/python2.5/site-packages/scipy/linsolve/__init__.py:4: DeprecationWarning: scipy.linsolve has moved to scipy.sparse.linalg.dsolve warn('scipy.linsolve has moved to scipy.sparse.linalg.dsolve', DeprecationWarning) +++ test_input: ok 1 test file executed in 1.55 s, 0 failure(s) of 1 test(s)

Logan Sorenson wrote:
Hi again,
I just ran ./runTests.py with the latest git and I noticed one test was failing (tests/test_input_linear_elastic.py). However, when I ran ./runTests.py --debug tests/test_input_linear_elastic.py, the test is passing. It also passes with just ./runTests.py tests/test_input_linear_elastic.py. Here's the output:
This is strange. Try running all the tests with --debug, i.e.
./runTests.py --debug
Maybe there is some unwanted interaction in play. I do not get any failures, though.
r.

Hi,
I think I identified the source of the problem. Basically, there is an unwanted interaction between tests/test_input_linear_elastic.py and tests/test_input_linear_elastic_dynamic.py. Since the test_input_linear_elastic_dynamic case is run first (at least on my machine) and input/linear_elastic_dynamic.py imports from input/linear_elastic.py, it looks like python is compiling linear_elastic.py -> linear_elastic.pyc for the linear_elastic_dynamic case, and then reusing that module when it imports again for the linear_elastic case. It picks up the ebcs as {'PerturbedSurface': ('Right', {'u.0': 'ebc_sin', 'u.1': 0.0, 'u.2': 0.0}), 'Fixed': ('Left', {'u.all': 0.0})} instead of the correct boundary conditions from linear_elastic.py, so it fails when it tries to find the ebc_sin function which no longer exists. Hope that is clear. :)
What would be the pythonic way to fix this? Is there a way to force python to recompile the input files when running tests?
Thanks! Logan
On Fri, Oct 2, 2009 at 4:55 AM, Robert Cimrman <cimr...@ntc.zcu.cz> wrote:
Logan Sorenson wrote:
Hi again,
I just ran ./runTests.py with the latest git and I noticed one test was failing (tests/test_input_linear_elastic.py). However, when I ran ./runTests.py --debug tests/test_input_linear_elastic.py, the test is passing. It also passes with just ./runTests.py tests/test_input_linear_elastic.py. Here's the output:
This is strange. Try running all the tests with --debug, i.e.
./runTests.py --debug
Maybe there is some unwanted interaction in play. I do not get any failures, though.
r.

Hi Logan,
you are absolutely correct, I have found that interaction too - it is already fixed.
This is the commit af3ef4a27d82856 message:
fix import_file() for multiple imports
- the tests tests/test_input_linear_elastic_dynamic.py (1) and tests/test_input_linear_elastic.py (2) interacted, as (1) imports (2) and modifies some configuration (e.g. ebcs) - the test (2) then wrongly used the modified configuration as the module (2) was not reloaded
Look into sfepy/base/base.py at import_file() to see how to force a module reload.
This bug was rather tedious to track down on my slow old laptop - I even updated runTests.py to be able to run several selected tests together.
Thanks for pointing this out, as the bug did not manifest on my main computer.
r.
Logan Sorenson wrote:
Hi,
I think I identified the source of the problem. Basically, there is an unwanted interaction between tests/test_input_linear_elastic.py and tests/test_input_linear_elastic_dynamic.py. Since the test_input_linear_elastic_dynamic case is run first (at least on my machine) and input/linear_elastic_dynamic.py imports from input/linear_elastic.py, it looks like python is compiling linear_elastic.py -> linear_elastic.pyc for the linear_elastic_dynamic case, and then reusing that module when it imports again for the linear_elastic case. It picks up the ebcs as {'PerturbedSurface': ('Right', {'u.0': 'ebc_sin', 'u.1': 0.0, 'u.2': 0.0}), 'Fixed': ('Left', {'u.all': 0.0})} instead of the correct boundary conditions from linear_elastic.py, so it fails when it tries to find the ebc_sin function which no longer exists. Hope that is clear. :)
What would be the pythonic way to fix this? Is there a way to force python to recompile the input files when running tests?

Hi Robert,
On Mon, Oct 5, 2009 at 4:30 AM, Robert Cimrman <cimr...@ntc.zcu.cz> wrote:
Hi Logan,
you are absolutely correct, I have found that interaction too - it is already fixed.
Wow, that's fast!
This is the commit af3ef4a27d82856 message:
fix import_file() for multiple imports
- the tests tests/test_input_linear_elastic_dynamic.py (1) and tests/test_input_linear_elastic.py (2) interacted, as (1) imports (2) and modifies some configuration (e.g. ebcs) - the test (2) then wrongly used the modified configuration as the module (2) was not reloaded
Look into sfepy/base/base.py at import_file() to see how to force a module reload.
Ok, this is interesting. I was not aware of the reload function. That looks pretty simple then. I did a git pull and a make and now all tests pass!
This bug was rather tedious to track down on my slow old laptop - I even updated runTests.py to be able to run several selected tests together.
I ended up removing tests one by one from a copy of the tests directory to isolate the problem. This seems much better! :)
Thanks for pointing this out, as the bug did not manifest on my main computer.
No problem, glad to help out where I can. Thanks for the great software and all your effort!
Best, Logan

Logan Sorenson wrote:
you are absolutely correct, I have found that interaction too - it is already fixed.
Wow, that's fast!
You were lucky that the bug did show on my laptop...
Look into sfepy/base/base.py at import_file() to see how to force a module reload.
Ok, this is interesting. I was not aware of the reload function. That looks pretty simple then. I did a git pull and a make and now all tests pass!
Great!
This bug was rather tedious to track down on my slow old laptop - I even updated runTests.py to be able to run several selected tests together.
I ended up removing tests one by one from a copy of the tests directory to isolate the problem. This seems much better! :)
I was too lazy to copy the files, so I changed a few lines of the testing script instead :)
Thanks for pointing this out, as the bug did not manifest on my main computer.
No problem, glad to help out where I can. Thanks for the great software and all your effort!
It's always good to hear that our software may be useful, thanks for such kind words.
r.
participants (2)
-
Logan Sorenson
-
Robert Cimrman