sbrisard / janus

Discretization of the Lippmann--Schwinger equation with periodic boundary conditions
BSD 3-Clause "New" or "Revised" License
9 stars 3 forks source link

test_discrete_green_operator.py crashes the Python vm under windows #14

Closed sbrisard closed 9 years ago

sbrisard commented 9 years ago

Janus compiled with Microsoft Windows SDK v7.1. Execution of the following line of code

python -m pytest -v tests\test_discrete_green_operator.py

Results in the Python VM crashing after

tests/test_discrete_green_operator.py::TestFilteredGreenOperator::test_apply[C:\Users\brisard\Documents\travail\projets_de_recherche\janus\tests\data\filtered_green_operator_40x50x60_unit_tau_xx_10x10x10+15+20+25.npz-2.22044604925e-16-1] PASSED

Test which likely fails is

test_apply('filtered_green_operator_40x50x60_unit_tau_xx_10x10x10+15+20+25.npz',
            2.22044604925e-16,
            2)
sbrisard commented 9 years ago

Could not reproduce the crash with the simple script

import os.path

import test_discrete_green_operator

if __name__ == '__main__':
    directory = os.path.dirname(os.path.realpath(__file__))
    basename = 'filtered_green_operator_40x50x60_unit_tau_xx_10x10x10+15+20+25.npz'
    name = os.path.join(directory, 'data', basename)
    test = test_discrete_green_operator.TestFilteredGreenOperator()
    test.test_apply(name, test_discrete_green_operator.ULP, 2)
sbrisard commented 9 years ago

There is a major error in class FilteredGreenOperator3D.apply(). The following line

cdef int[:] b = array((2,), sizeof(int), 'i')

should really read

cdef int[:] b = array((3,), sizeof(int), 'i')

As of commit 881ae4d, this is corrected. I don't know how this bug went unnoticed under Linux!