當前位置: 首頁>>代碼示例>>Python>>正文


Python core.Extension方法代碼示例

本文整理匯總了Python中numpy.distutils.core.Extension方法的典型用法代碼示例。如果您正苦於以下問題:Python core.Extension方法的具體用法?Python core.Extension怎麽用?Python core.Extension使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在numpy.distutils.core的用法示例。


在下文中一共展示了core.Extension方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: add_library

# 需要導入模塊: from numpy.distutils import core [as 別名]
# 或者: from numpy.distutils.core import Extension [as 別名]
def add_library(self,name,sources,**build_info):
        """
        Add library to configuration.

        Parameters
        ----------
        name : str
            Name of the extension.
        sources : sequence
            List of the sources. The list of sources may contain functions
            (called source generators) which must take an extension instance
            and a build directory as inputs and return a source file or list of
            source files or None. If None is returned then no sources are
            generated. If the Extension instance has no sources after
            processing all source generators, then no extension module is
            built.
        build_info : dict, optional
            The following keys are allowed:

                * depends
                * macros
                * include_dirs
                * extra_compiler_args
                * extra_f77_compile_args
                * extra_f90_compile_args
                * f2py_options
                * language

        """
        self._add_library(name, sources, None, build_info)

        dist = self.get_distribution()
        if dist is not None:
            self.warn('distutils distribution has been initialized,'\
                      ' it may be too late to add a library '+ name) 
開發者ID:Frank-qlu,項目名稱:recruit,代碼行數:37,代碼來源:misc_util.py

示例2: append_to

# 需要導入模塊: from numpy.distutils import core [as 別名]
# 或者: from numpy.distutils.core import Extension [as 別名]
def append_to(self, extlib):
        """Append libraries, include_dirs to extension or library item.
        """
        if is_sequence(extlib):
            lib_name, build_info = extlib
            dict_append(build_info,
                        libraries=self.libraries,
                        include_dirs=self.include_dirs)
        else:
            from numpy.distutils.core import Extension
            assert isinstance(extlib, Extension), repr(extlib)
            extlib.libraries.extend(self.libraries)
            extlib.include_dirs.extend(self.include_dirs) 
開發者ID:Frank-qlu,項目名稱:recruit,代碼行數:15,代碼來源:misc_util.py

示例3: add_library

# 需要導入模塊: from numpy.distutils import core [as 別名]
# 或者: from numpy.distutils.core import Extension [as 別名]
def add_library(self,name,sources,**build_info):
        """
        Add library to configuration.

        Parameters
        ----------
        name : str
            Name of the extension.
        sources : sequence
            List of the sources. The list of sources may contain functions
            (called source generators) which must take an extension instance
            and a build directory as inputs and return a source file or list of
            source files or None. If None is returned then no sources are
            generated. If the Extension instance has no sources after
            processing all source generators, then no extension module is
            built.
        build_info : dict, optional
            The following keys are allowed:

                * depends
                * macros
                * include_dirs
                * extra_compiler_args
                * extra_f77_compiler_args
                * extra_f90_compiler_args
                * f2py_options
                * language

        """
        self._add_library(name, sources, None, build_info)

        dist = self.get_distribution()
        if dist is not None:
            self.warn('distutils distribution has been initialized,'\
                      ' it may be too late to add a library '+ name) 
開發者ID:abhisuri97,項目名稱:auto-alt-text-lambda-api,代碼行數:37,代碼來源:misc_util.py

示例4: configuration

# 需要導入模塊: from numpy.distutils import core [as 別名]
# 或者: from numpy.distutils.core import Extension [as 別名]
def configuration(parent_package='', top_path=None):
    from numpy.distutils.misc_util import Configuration

    config = Configuration('randomkit', parent_package, top_path)
    libs = []
    if sys.platform == 'win32':
        libs.append('Advapi32')

    extensions = [Extension('modl.utils.randomkit.random_fast',
                            sources=['modl/utils/randomkit/random_fast.pyx',
                                     'modl/utils/randomkit/randomkit.c',
                                     'modl/utils/randomkit/distributions.c',
                                     ],
                            language="c++",
                            include_dirs=[numpy.get_include(),
                                          'modl/utils/randomkit'],
                            ),
                  Extension('modl.utils.randomkit.sampler',
                            sources=['modl/utils/randomkit/sampler.pyx'],
                            language="c++",
                            include_dirs=[numpy.get_include()]
                            )]
    config.ext_modules += extensions

    config.add_subpackage('tests')

    return config 
開發者ID:arthurmensch,項目名稱:modl,代碼行數:29,代碼來源:setup.py


注:本文中的numpy.distutils.core.Extension方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。