Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

MAINT: linalg: clean up LAPACK and BLAS wrappers + document them #358

Closed
wants to merge 22 commits into from

3 participants

@pv
Owner
pv commented

The BLAS/LAPACK interfaces in scipy.linalg were sort of public, but the LAPACK part was only partly cleaned up last time when the scipy.lib.blas/lapack interfaces were deprecated. Moreover, they were essentially undocumented.

This PR cleans up the following:

  • Make get_lapack_funcs fully compatible with get_blas_funcs, while maintaining backward compatibility.

  • Add missing deprecation warnings to scipy.lib.lapack and scipy.lib.blas

  • Add deprecation warnings to direct imports of scipy.linalg.fblas, .cblas, .flapack, .clapack which probably appear in existing third-party code.

  • Remove dead code in linalg functions (checks for clapack functions, which never exist)

  • Add missing functions to scipy.linalg which were in scipy.lib.

scipy/linalg/blas.py
((111 lines not shown))
-import numpy as np
-# The following ensures that possibly missing flavor (C or Fortran) is
-# replaced with the available one. If none is available, exception
-# is raised at the first attempt to use the resources.
+from scipy.linalg import _cblas, _fblas
@rgommers Owner

This needs to be wrapped in try/except. cblas may not be built.

@pv Owner
pv added a note

Yep, needs a rebase.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@rgommers
Owner

SConscript needs a tweak and the deprecations should be noted in the release notes. For the rest this looks good. Only tested on 2.7 so far.

pv added some commits
@pv pv ENH: linalg: unify the get_lapack_funcs with get_blas_funcs 3b16847
@pv pv DEP: lib: deprecate scipy.lib.get_lapack_funcs 53728e6
@pv pv BUG: linalg: define some lapack aliases necessary for decomp_qr 91ac56d
@pv pv ENH: linalg: document the low-level functions, and deal with some bac…
…kward compatibility issues
4084100
@pv pv BUG: linalg: backward compatibility fixes in get_blas/lapack_funcs 13dfeae
@pv pv MAINT: linalg: .prefix -> .typecode c3a10a1
@pv pv MAINT: linalg/decomp: remove obsolete clapack/flapack special casing …
…(those functions are not in clapack)
b39d978
@pv pv MAINT: linalg/basic: remove obsolete clapack/flapack special casing (…
…those functions are not in clapack)
2384ff5
@pv pv MAINT: linalg/decomp_svd: remove obsolete clapack/flapack special cas…
…ing (those functions are not in clapack)
9e9cc7b
@pv pv BUG: linalg: fix bug in find_best_blas_type regarding complex-valued …
…upcasting
114ad37
@pv pv ENH: linalg: properly expose the BLAS/LAPACK wrappers, and document this 082b39a
@pv pv DEP: linalg: add _ prefix to *blas, *lapack and deprecate the f2py mo…
…dules from semi-public API

Instead, allow using scipy.linalg.blas / scipy.linalg.lapack
a61b2b3
@pv pv DEP: mark scipy.lib.blas and scipy.lib.lapack as deprecated a3168ef
@pv pv ENH: linalg/lapack: add *heevd, *syevd, which were in scipy.lib.lapac…
…k but not in scipy.linalg.lapack
96b0343
@pv pv MAINT: linalg: fortran lapack/blas are always available, cblas/clapac…
…k are always only partial

Remove some dead code substituting cblas/lapack with fblas/lapack if one
of them is not available.  This doesn't actually do anything, since the
Fortran BLAS/LAPACK is always available. Moreover the C blas/lapack are
only partial wrappers.
067de33
@pv pv DOC: linalg: add some versionadded:: statements 415f30e
@pv pv DOC: link linalg.blas/lapack docs to the documentation tree f782b20
@pv pv DOC: linalg/lapack: add some routines to the list ef413eb
@pv pv DOC: update release notes wrt BLAS/LAPACK interfaces a4f9d26
@pv pv TST: linalg: fix cblas/clapack imports in tests f14d232
@pv pv TST: linalg: fix assumption about existing cblas in test dae0b0b
@pv pv TST: linalg: set random seeds in tests 0f7ae6b
@pv
Owner
pv commented

Rebased + updated release notes.

@rgommers
Owner

Tested again on 2.7 and 3.2, all looks good. Merged in 665e3cb. Thanks Pauli.

@rgommers rgommers closed this
@nouiz

This PR broke Theano. This remove the import of scipy.linalg.fblas. The commit 3a2558e indicate that this is deprecated not removed.

See Theano PR Theano/Theano#1150 for a work around we did. Can you confirm you want to remove it and not deprecate it now?

@nouiz nouiz referenced this pull request in Theano/Theano
Merged

Fix for new name of scipy.linalg.blas.fblas #1150

@pv
Owner
pv commented

The intent was to deprecate it, not remove it. But I see the import in Theano was scipy.linalg.blas.fblas rather than scipy.linalg.fblas, so a dummy object would need to be added for backward compatibility. (Again, an argument for prefixing all private modules with _...)

Filing a bug ticket would ensure that we don't lose track of this.

@ClemensFMN ClemensFMN referenced this pull request from a commit
Commit has since been removed from the repository and is no longer available.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 28, 2012
  1. @pv
  2. @pv
  3. @pv
  4. @pv

    ENH: linalg: document the low-level functions, and deal with some bac…

    pv authored
    …kward compatibility issues
  5. @pv
  6. @pv

    MAINT: linalg: .prefix -> .typecode

    pv authored
  7. @pv

    MAINT: linalg/decomp: remove obsolete clapack/flapack special casing …

    pv authored
    …(those functions are not in clapack)
  8. @pv

    MAINT: linalg/basic: remove obsolete clapack/flapack special casing (…

    pv authored
    …those functions are not in clapack)
  9. @pv

    MAINT: linalg/decomp_svd: remove obsolete clapack/flapack special cas…

    pv authored
    …ing (those functions are not in clapack)
  10. @pv
  11. @pv
  12. @pv

    DEP: linalg: add _ prefix to *blas, *lapack and deprecate the f2py mo…

    pv authored
    …dules from semi-public API
    
    Instead, allow using scipy.linalg.blas / scipy.linalg.lapack
  13. @pv
  14. @pv

    ENH: linalg/lapack: add *heevd, *syevd, which were in scipy.lib.lapac…

    pv authored
    …k but not in scipy.linalg.lapack
  15. @pv

    MAINT: linalg: fortran lapack/blas are always available, cblas/clapac…

    pv authored
    …k are always only partial
    
    Remove some dead code substituting cblas/lapack with fblas/lapack if one
    of them is not available.  This doesn't actually do anything, since the
    Fortran BLAS/LAPACK is always available. Moreover the C blas/lapack are
    only partial wrappers.
  16. @pv
  17. @pv
  18. @pv
  19. @pv
  20. @pv
  21. @pv
  22. @pv
Something went wrong with that request. Please try again.