spectralDNS / shenfun

High performance computational platform in Python for the spectral Galerkin method
http://shenfun.readthedocs.org
BSD 2-Clause "Simplified" License
201 stars 42 forks source link

spectralDNS tests fail because it expects the function pyfftw.builders.dct #6

Closed ashwinvis closed 6 years ago

ashwinvis commented 6 years ago

When I run pytest -v I see a lot of test failures (see test summary below):


test_MHD.py::test_MHD[uniform] PASSED                                                                                                                                                          [  2%]
test_MHD.py::test_MHD[nonuniform] PASSED                                                                                                                                                       [  4%]
test_NS2D.py::test_NS2D[1] PASSED                                                                                                                                                              [  6%]
test_NS2D.py::test_NS2D[2] PASSED                                                                                                                                                              [  8%]
test_NSVV.py::test_solvers[NS_uniform] PASSED                                                                                                                                                  [ 10%]
test_NSVV.py::test_solvers[VV_uniform] PASSED                                                                                                                                                  [ 12%]
test_NSVV.py::test_solvers[NS_nonuniform] PASSED                                                                                                                                               [ 14%]
test_NSVV.py::test_solvers[VV_nonuniform] PASSED                                                                                                                                               [ 16%]
test_NSVV.py::test_integrators[NS_uniform] FAILED                                                                                                                                              [ 18%]
test_NSVV.py::test_integrators[VV_uniform] FAILED                                                                                                                                              [ 20%]
test_NSVV.py::test_integrators[NS_nonuniform] FAILED                                                                                                                                           [ 22%]
test_NSVV.py::test_integrators[VV_nonuniform] FAILED                                                                                                                                           [ 24%]
test_channel.py::test_channel[KMMRK3] FAILED                                                                                                                                                   [ 26%]
test_channel.py::test_channel[KMM] FAILED                                                                                                                                                      [ 28%]
test_channel.py::test_channel[IPCS] SKIPPED                                                                                                                                                    [ 30%]
test_channel.py::test_channel[IPCSR] SKIPPED                                                                                                                                                   [ 32%]
test_channel.py::test_channel[KMMRK3_mpifft4py] FAILED                                                                                                                                         [ 34%]
test_channel.py::test_channel[KMM_mpifft4py] FAILED                                                                                                                                            [ 36%]
test_shentransforms.py::test_FST[GC-Basis] FAILED                                                                                                                                              [ 38%]
test_shentransforms.py::test_FST[GC-ShenDirichletBasis] FAILED                                                                                                                                 [ 40%]
test_shentransforms.py::test_FST[GC-ShenNeumannBasis] FAILED                                                                                                                                   [ 42%]
test_shentransforms.py::test_FST[GC-ShenBiharmonicBasis] FAILED                                                                                                                                [ 44%]
test_shentransforms.py::test_FST[GL-Basis] FAILED                                                                                                                                              [ 46%]
test_shentransforms.py::test_FST[GL-ShenDirichletBasis] FAILED                                                                                                                                 [ 48%]
test_shentransforms.py::test_FST[GL-ShenNeumannBasis] FAILED                                                                                                                                   [ 51%]
test_shentransforms.py::test_FST[GL-ShenBiharmonicBasis] FAILED                                                                                                                                [ 53%]
test_shentransforms.py::test_FST_padded[GC-Basis] FAILED                                                                                                                                       [ 55%]
test_shentransforms.py::test_FST_padded[GC-ShenDirichletBasis] FAILED                                                                                                                          [ 57%]
test_shentransforms.py::test_FST_padded[GC-ShenNeumannBasis] FAILED                                                                                                                            [ 59%]
test_shentransforms.py::test_FST_padded[GC-ShenBiharmonicBasis] FAILED                                                                                                                         [ 61%]
test_shentransforms.py::test_FST_padded[GL-Basis] FAILED                                                                                                                                       [ 63%]
test_shentransforms.py::test_FST_padded[GL-ShenDirichletBasis] FAILED                                                                                                                          [ 65%]
test_shentransforms.py::test_FST_padded[GL-ShenNeumannBasis] FAILED                                                                                                                            [ 67%]
test_shentransforms.py::test_FST_padded[GL-ShenBiharmonicBasis] FAILED                                                                                                                         [ 69%]
test_shentransforms.py::test_Mult_Div FAILED                                                                                                                                                   [ 71%]
test_shentransforms.py::test_Helmholtz[GC-ShenDirichletBasis] FAILED                                                                                                                           [ 73%]
test_shentransforms.py::test_Helmholtz[GC-ShenNeumannBasis] FAILED                                                                                                                             [ 75%]
test_shentransforms.py::test_Helmholtz[GL-ShenDirichletBasis] FAILED                                                                                                                           [ 77%]
test_shentransforms.py::test_Helmholtz[GL-ShenNeumannBasis] FAILED                                                                                                                             [ 79%]
test_shentransforms.py::test_Helmholtz2[GC] FAILED                                                                                                                                             [ 81%]
test_shentransforms.py::test_Helmholtz2[GL] FAILED                                                                                                                                             [ 83%]
test_shentransforms.py::test_Mult_CTD[GC] FAILED                                                                                                                                               [ 85%]
test_shentransforms.py::test_Mult_CTD[GL] FAILED                                                                                                                                               [ 87%]
test_shentransforms.py::test_Mult_CTD_3D[GC] FAILED                                                                                                                                            [ 89%]
test_shentransforms.py::test_Mult_CTD_3D[GL] FAILED                                                                                                                                            [ 91%]
test_shentransforms.py::test_Biharmonic[GC] FAILED                                                                                                                                             [ 93%]
test_shentransforms.py::test_Biharmonic[GL] FAILED                                                                                                                                             [ 95%]
test_shentransforms.py::test_Helmholtz_matvec[GC] FAILED                                                                                                                                       [ 97%]
test_shentransforms.py::test_Helmholtz_matvec[GL] FAILED                                                                                                                                       [100%]

Most of the failures are due to AttributeErrors like:

self = <shenfun.chebyshev.bases.Basis object at 0x7fd643bd4910>, N = 64, quad = 'GL', plan = True, domain = (-1.0, 1.0)

    def __init__(self, N=0, quad="GC", plan=False, domain=(-1., 1.)):
        ChebyshevBase.__init__(self, N, quad, domain)
        if quad == 'GC':
            self._xfftn_fwd = functools.partial(pyfftw.builders.dct, type=2)
            self._xfftn_bck = functools.partial(pyfftw.builders.dct, type=3)
        else:
>           self._xfftn_fwd = functools.partial(pyfftw.builders.dct, type=1)
E           AttributeError: 'module' object has no attribute 'dct'

/scratch/avmo/opt/spectraldns/lib/python2.7/site-packages/shenfun/chebyshev/bases.py:202: AttributeError

I am using the latest version of pyfftw

» pip show pyfftw
Name: pyFFTW
Version: 0.10.4
Summary: A pythonic wrapper around FFTW, the FFT library, presenting a unified interface for all the supported transforms.
Home-page: http://hgomersall.github.com/pyFFTW/
Author: Henry Gomersall
Author-email: heng@kedevelopments.co.uk
License: UNKNOWN
Location: /scratch/avmo/opt/spectraldns/lib/python2.7/site-packages
Requires: 

And even in their github master version I don't see this dct function: https://github.com/pyFFTW/pyFFTW/blob/master/pyfftw/builders/builders.py. Are you using a modified version of pyFFTW?

mikaem commented 6 years ago

Hi and thanks for creating this issue. Unfortunately, the dct is not part of the main pyfftw, but it has been implemented in this branch. It is also available in the spectralDNS channel on Anaconda cloud.

ashwinvis commented 6 years ago

Thank you @mikaem! All tests pass 👍

ashwinvis commented 6 years ago

Referencing issue spectralDNS/spectralDNS/issues/23