Python numpy.source() Examples

The following are 30 code examples for showing how to use numpy.source(). These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example.

You may check out the related API usage on the sidebar.

You may also want to check out all available functions/classes of the module numpy , or try the search function .

Example 1
Project: recruit   Author: Frank-qlu   File: utils.py    License: Apache License 2.0 5 votes vote down vote up
def get_include():
    """
    Return the directory that contains the NumPy \\*.h header files.

    Extension modules that need to compile against NumPy should use this
    function to locate the appropriate include directory.

    Notes
    -----
    When using ``distutils``, for example in ``setup.py``.
    ::

        import numpy as np
        ...
        Extension('extension_name', ...
                include_dirs=[np.get_include()])
        ...

    """
    import numpy
    if numpy.show_config is None:
        # running from numpy source directory
        d = os.path.join(os.path.dirname(numpy.__file__), 'core', 'include')
    else:
        # using installed numpy core headers
        import numpy.core as core
        d = os.path.join(os.path.dirname(core.__file__), 'include')
    return d 
Example 2
Project: recruit   Author: Frank-qlu   File: utils.py    License: Apache License 2.0 5 votes vote down vote up
def default(self, node):
        raise SyntaxError("Unsupported source construct: %s"
                          % node.__class__) 
Example 3
Project: lambda-packs   Author: ryfeus   File: utils.py    License: MIT License 5 votes vote down vote up
def get_include():
    """
    Return the directory that contains the NumPy \\*.h header files.

    Extension modules that need to compile against NumPy should use this
    function to locate the appropriate include directory.

    Notes
    -----
    When using ``distutils``, for example in ``setup.py``.
    ::

        import numpy as np
        ...
        Extension('extension_name', ...
                include_dirs=[np.get_include()])
        ...

    """
    import numpy
    if numpy.show_config is None:
        # running from numpy source directory
        d = os.path.join(os.path.dirname(numpy.__file__), 'core', 'include')
    else:
        # using installed numpy core headers
        import numpy.core as core
        d = os.path.join(os.path.dirname(core.__file__), 'include')
    return d 
Example 4
Project: lambda-packs   Author: ryfeus   File: utils.py    License: MIT License 5 votes vote down vote up
def default(self, node):
        raise SyntaxError("Unsupported source construct: %s"
                          % node.__class__) 
Example 5
Project: lambda-packs   Author: ryfeus   File: utils.py    License: MIT License 5 votes vote down vote up
def get_include():
    """
    Return the directory that contains the NumPy \\*.h header files.

    Extension modules that need to compile against NumPy should use this
    function to locate the appropriate include directory.

    Notes
    -----
    When using ``distutils``, for example in ``setup.py``.
    ::

        import numpy as np
        ...
        Extension('extension_name', ...
                include_dirs=[np.get_include()])
        ...

    """
    import numpy
    if numpy.show_config is None:
        # running from numpy source directory
        d = os.path.join(os.path.dirname(numpy.__file__), 'core', 'include')
    else:
        # using installed numpy core headers
        import numpy.core as core
        d = os.path.join(os.path.dirname(core.__file__), 'include')
    return d 
Example 6
Project: lambda-packs   Author: ryfeus   File: utils.py    License: MIT License 5 votes vote down vote up
def default(self, node):
        raise SyntaxError("Unsupported source construct: %s"
                          % node.__class__) 
Example 7
Project: auto-alt-text-lambda-api   Author: abhisuri97   File: utils.py    License: MIT License 5 votes vote down vote up
def get_include():
    """
    Return the directory that contains the NumPy \\*.h header files.

    Extension modules that need to compile against NumPy should use this
    function to locate the appropriate include directory.

    Notes
    -----
    When using ``distutils``, for example in ``setup.py``.
    ::

        import numpy as np
        ...
        Extension('extension_name', ...
                include_dirs=[np.get_include()])
        ...

    """
    import numpy
    if numpy.show_config is None:
        # running from numpy source directory
        d = os.path.join(os.path.dirname(numpy.__file__), 'core', 'include')
    else:
        # using installed numpy core headers
        import numpy.core as core
        d = os.path.join(os.path.dirname(core.__file__), 'include')
    return d 
Example 8
Project: auto-alt-text-lambda-api   Author: abhisuri97   File: utils.py    License: MIT License 5 votes vote down vote up
def default(self, node):
        raise SyntaxError("Unsupported source construct: %s"
                          % node.__class__) 
Example 9
Project: vnpy_crypto   Author: birforce   File: utils.py    License: MIT License 5 votes vote down vote up
def get_include():
    """
    Return the directory that contains the NumPy \\*.h header files.

    Extension modules that need to compile against NumPy should use this
    function to locate the appropriate include directory.

    Notes
    -----
    When using ``distutils``, for example in ``setup.py``.
    ::

        import numpy as np
        ...
        Extension('extension_name', ...
                include_dirs=[np.get_include()])
        ...

    """
    import numpy
    if numpy.show_config is None:
        # running from numpy source directory
        d = os.path.join(os.path.dirname(numpy.__file__), 'core', 'include')
    else:
        # using installed numpy core headers
        import numpy.core as core
        d = os.path.join(os.path.dirname(core.__file__), 'include')
    return d 
Example 10
Project: vnpy_crypto   Author: birforce   File: utils.py    License: MIT License 5 votes vote down vote up
def default(self, node):
        raise SyntaxError("Unsupported source construct: %s"
                          % node.__class__) 
Example 11
Project: Computable   Author: ktraunmueller   File: utils.py    License: MIT License 5 votes vote down vote up
def get_include():
    """
    Return the directory that contains the NumPy \\*.h header files.

    Extension modules that need to compile against NumPy should use this
    function to locate the appropriate include directory.

    Notes
    -----
    When using ``distutils``, for example in ``setup.py``.
    ::

        import numpy as np
        ...
        Extension('extension_name', ...
                include_dirs=[np.get_include()])
        ...

    """
    import numpy
    if numpy.show_config is None:
        # running from numpy source directory
        d = os.path.join(os.path.dirname(numpy.__file__), 'core', 'include')
    else:
        # using installed numpy core headers
        import numpy.core as core
        d = os.path.join(os.path.dirname(core.__file__), 'include')
    return d 
Example 12
Project: Computable   Author: ktraunmueller   File: utils.py    License: MIT License 5 votes vote down vote up
def default(self, node, **kw):
            raise SyntaxError("Unsupported source construct: %s"
                              % node.__class__) 
Example 13
Project: Computable   Author: ktraunmueller   File: utils.py    License: MIT License 5 votes vote down vote up
def default(self, node):
            raise SyntaxError("Unsupported source construct: %s"
                              % node.__class__) 
Example 14
Project: Mastering-Elasticsearch-7.0   Author: PacktPublishing   File: utils.py    License: MIT License 5 votes vote down vote up
def get_include():
    """
    Return the directory that contains the NumPy \\*.h header files.

    Extension modules that need to compile against NumPy should use this
    function to locate the appropriate include directory.

    Notes
    -----
    When using ``distutils``, for example in ``setup.py``.
    ::

        import numpy as np
        ...
        Extension('extension_name', ...
                include_dirs=[np.get_include()])
        ...

    """
    import numpy
    if numpy.show_config is None:
        # running from numpy source directory
        d = os.path.join(os.path.dirname(numpy.__file__), 'core', 'include')
    else:
        # using installed numpy core headers
        import numpy.core as core
        d = os.path.join(os.path.dirname(core.__file__), 'include')
    return d 
Example 15
Project: Mastering-Elasticsearch-7.0   Author: PacktPublishing   File: utils.py    License: MIT License 5 votes vote down vote up
def default(self, node):
        raise SyntaxError("Unsupported source construct: %s"
                          % node.__class__) 
Example 16
Project: GraphicDesignPatternByPython   Author: Relph1119   File: utils.py    License: MIT License 5 votes vote down vote up
def get_include():
    """
    Return the directory that contains the NumPy \\*.h header files.

    Extension modules that need to compile against NumPy should use this
    function to locate the appropriate include directory.

    Notes
    -----
    When using ``distutils``, for example in ``setup.py``.
    ::

        import numpy as np
        ...
        Extension('extension_name', ...
                include_dirs=[np.get_include()])
        ...

    """
    import numpy
    if numpy.show_config is None:
        # running from numpy source directory
        d = os.path.join(os.path.dirname(numpy.__file__), 'core', 'include')
    else:
        # using installed numpy core headers
        import numpy.core as core
        d = os.path.join(os.path.dirname(core.__file__), 'include')
    return d 
Example 17
Project: GraphicDesignPatternByPython   Author: Relph1119   File: utils.py    License: MIT License 5 votes vote down vote up
def default(self, node):
        raise SyntaxError("Unsupported source construct: %s"
                          % node.__class__) 
Example 18
Project: predictive-maintenance-using-machine-learning   Author: awslabs   File: utils.py    License: Apache License 2.0 5 votes vote down vote up
def get_include():
    """
    Return the directory that contains the NumPy \\*.h header files.

    Extension modules that need to compile against NumPy should use this
    function to locate the appropriate include directory.

    Notes
    -----
    When using ``distutils``, for example in ``setup.py``.
    ::

        import numpy as np
        ...
        Extension('extension_name', ...
                include_dirs=[np.get_include()])
        ...

    """
    import numpy
    if numpy.show_config is None:
        # running from numpy source directory
        d = os.path.join(os.path.dirname(numpy.__file__), 'core', 'include')
    else:
        # using installed numpy core headers
        import numpy.core as core
        d = os.path.join(os.path.dirname(core.__file__), 'include')
    return d 
Example 19
Project: predictive-maintenance-using-machine-learning   Author: awslabs   File: utils.py    License: Apache License 2.0 5 votes vote down vote up
def default(self, node):
        raise SyntaxError("Unsupported source construct: %s"
                          % node.__class__) 
Example 20
Project: Fluid-Designer   Author: Microvellum   File: utils.py    License: GNU General Public License v3.0 5 votes vote down vote up
def get_include():
    """
    Return the directory that contains the NumPy \\*.h header files.

    Extension modules that need to compile against NumPy should use this
    function to locate the appropriate include directory.

    Notes
    -----
    When using ``distutils``, for example in ``setup.py``.
    ::

        import numpy as np
        ...
        Extension('extension_name', ...
                include_dirs=[np.get_include()])
        ...

    """
    import numpy
    if numpy.show_config is None:
        # running from numpy source directory
        d = os.path.join(os.path.dirname(numpy.__file__), 'core', 'include')
    else:
        # using installed numpy core headers
        import numpy.core as core
        d = os.path.join(os.path.dirname(core.__file__), 'include')
    return d 
Example 21
Project: Fluid-Designer   Author: Microvellum   File: utils.py    License: GNU General Public License v3.0 5 votes vote down vote up
def default(self, node, **kw):
            raise SyntaxError("Unsupported source construct: %s"
                              % node.__class__) 
Example 22
Project: Fluid-Designer   Author: Microvellum   File: utils.py    License: GNU General Public License v3.0 5 votes vote down vote up
def default(self, node):
            raise SyntaxError("Unsupported source construct: %s"
                              % node.__class__) 
Example 23
Project: pySINDy   Author: luckystarufo   File: utils.py    License: MIT License 5 votes vote down vote up
def get_include():
    """
    Return the directory that contains the NumPy \\*.h header files.

    Extension modules that need to compile against NumPy should use this
    function to locate the appropriate include directory.

    Notes
    -----
    When using ``distutils``, for example in ``setup.py``.
    ::

        import numpy as np
        ...
        Extension('extension_name', ...
                include_dirs=[np.get_include()])
        ...

    """
    import numpy
    if numpy.show_config is None:
        # running from numpy source directory
        d = os.path.join(os.path.dirname(numpy.__file__), 'core', 'include')
    else:
        # using installed numpy core headers
        import numpy.core as core
        d = os.path.join(os.path.dirname(core.__file__), 'include')
    return d 
Example 24
Project: pySINDy   Author: luckystarufo   File: utils.py    License: MIT License 5 votes vote down vote up
def default(self, node):
        raise SyntaxError("Unsupported source construct: %s"
                          % node.__class__) 
Example 25
Project: mxnet-lambda   Author: awslabs   File: utils.py    License: Apache License 2.0 5 votes vote down vote up
def get_include():
    """
    Return the directory that contains the NumPy \\*.h header files.

    Extension modules that need to compile against NumPy should use this
    function to locate the appropriate include directory.

    Notes
    -----
    When using ``distutils``, for example in ``setup.py``.
    ::

        import numpy as np
        ...
        Extension('extension_name', ...
                include_dirs=[np.get_include()])
        ...

    """
    import numpy
    if numpy.show_config is None:
        # running from numpy source directory
        d = os.path.join(os.path.dirname(numpy.__file__), 'core', 'include')
    else:
        # using installed numpy core headers
        import numpy.core as core
        d = os.path.join(os.path.dirname(core.__file__), 'include')
    return d 
Example 26
Project: mxnet-lambda   Author: awslabs   File: utils.py    License: Apache License 2.0 5 votes vote down vote up
def default(self, node):
        raise SyntaxError("Unsupported source construct: %s"
                          % node.__class__) 
Example 27
Project: ImageFusion   Author: pfchai   File: utils.py    License: MIT License 5 votes vote down vote up
def get_include():
    """
    Return the directory that contains the NumPy \\*.h header files.

    Extension modules that need to compile against NumPy should use this
    function to locate the appropriate include directory.

    Notes
    -----
    When using ``distutils``, for example in ``setup.py``.
    ::

        import numpy as np
        ...
        Extension('extension_name', ...
                include_dirs=[np.get_include()])
        ...

    """
    import numpy
    if numpy.show_config is None:
        # running from numpy source directory
        d = os.path.join(os.path.dirname(numpy.__file__), 'core', 'include')
    else:
        # using installed numpy core headers
        import numpy.core as core
        d = os.path.join(os.path.dirname(core.__file__), 'include')
    return d 
Example 28
Project: ImageFusion   Author: pfchai   File: utils.py    License: MIT License 5 votes vote down vote up
def default(self, node, **kw):
            raise SyntaxError("Unsupported source construct: %s"
                              % node.__class__) 
Example 29
Project: ImageFusion   Author: pfchai   File: utils.py    License: MIT License 5 votes vote down vote up
def default(self, node):
            raise SyntaxError("Unsupported source construct: %s"
                              % node.__class__) 
Example 30
Project: Splunking-Crime   Author: nccgroup   File: utils.py    License: GNU Affero General Public License v3.0 5 votes vote down vote up
def get_include():
    """
    Return the directory that contains the NumPy \\*.h header files.

    Extension modules that need to compile against NumPy should use this
    function to locate the appropriate include directory.

    Notes
    -----
    When using ``distutils``, for example in ``setup.py``.
    ::

        import numpy as np
        ...
        Extension('extension_name', ...
                include_dirs=[np.get_include()])
        ...

    """
    import numpy
    if numpy.show_config is None:
        # running from numpy source directory
        d = os.path.join(os.path.dirname(numpy.__file__), 'core', 'include')
    else:
        # using installed numpy core headers
        import numpy.core as core
        d = os.path.join(os.path.dirname(core.__file__), 'include')
    return d