Skip to content

Commit

Permalink
ENH: Added the function get_linalg_dir to get the directory containin…
Browse files Browse the repository at this point in the history
…g scipy.linalg.
  • Loading branch information
insertinterestingnamehere committed Mar 18, 2015
1 parent 445f9be commit 5087adc
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
11 changes: 11 additions & 0 deletions scipy/linalg/__init__.py
Expand Up @@ -139,6 +139,16 @@
toeplitz - Toeplitz matrix
tri - Construct a matrix filled with ones at and below a given diagonal
Utility Functions
=================
.. autosummary::
:toctree: generated/
get_linalg_dir - Get the directory where scipy.linalg is installed
Low-level routines
==================
Expand All @@ -162,6 +172,7 @@
from .linalg_version import linalg_version as __version__

from .misc import *
from .utils import *
from .basic import *
from .decomp import *
from .decomp_lu import *
Expand Down
28 changes: 28 additions & 0 deletions scipy/linalg/utils.py
@@ -0,0 +1,28 @@
from os.path import dirname, realpath

__all__ = ['get_linalg_dir']

def get_linalg_dir():
"""
Return the directory containing scipy.linalg.
This function should be used to get the proper include directory
to include the proper cython pxd files when using the Cython
wrappers for BLAS and LAPACK.
Notes
-----
When using ``distutils``, for example, in ``setup.py``.
::
from scipy.linalg import get_linalg_dir
...
Extension('extension_name', ...
include_dirs=[get_linalg_dir()])
...
"""
# Used to get the proper include directory to include f2pyptr.h
# and the cython pxd files when using the Cython wrappers
# for BLAS and LAPACK.
return dirname(realpath(__file__))

0 comments on commit 5087adc

Please sign in to comment.