当前位置: 首页>>代码示例>>Python>>正文


Python multiprocessing.sharedctypes方法代码示例

本文整理汇总了Python中multiprocessing.sharedctypes方法的典型用法代码示例。如果您正苦于以下问题:Python multiprocessing.sharedctypes方法的具体用法?Python multiprocessing.sharedctypes怎么用?Python multiprocessing.sharedctypes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在multiprocessing的用法示例。


在下文中一共展示了multiprocessing.sharedctypes方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: setUp

# 需要导入模块: import multiprocessing [as 别名]
# 或者: from multiprocessing import sharedctypes [as 别名]
def setUp(self):
        if not HAS_SHAREDCTYPES:
            self.skipTest("requires multiprocessing.sharedctypes") 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:5,代码来源:test_multiprocessing.py

示例2: test_import

# 需要导入模块: import multiprocessing [as 别名]
# 或者: from multiprocessing import sharedctypes [as 别名]
def test_import(self):
        modules = [
            'multiprocessing', 'multiprocessing.connection',
            'multiprocessing.heap', 'multiprocessing.managers',
            'multiprocessing.pool', 'multiprocessing.process',
            'multiprocessing.synchronize', 'multiprocessing.util'
            ]

        if HAS_REDUCTION:
            modules.append('multiprocessing.reduction')

        if c_int is not None:
            # This module requires _ctypes
            modules.append('multiprocessing.sharedctypes')

        for name in modules:
            __import__(name)
            mod = sys.modules[name]

            for attr in getattr(mod, '__all__', ()):
                self.assertTrue(
                    hasattr(mod, attr),
                    '%r does not have attribute %r' % (mod, attr)
                    )

#
# Quick test that logging works -- does not test logging output
# 
开发者ID:IronLanguages,项目名称:ironpython2,代码行数:30,代码来源:test_multiprocessing.py

示例3: __init__

# 需要导入模块: import multiprocessing [as 别名]
# 或者: from multiprocessing import sharedctypes [as 别名]
def __init__(self, keys, probe_seqs_ind, probe_pos, probe_seqs, k,
            probe_seqs_to_probe, native_dict):
        """Accepts arrays containing the information of a kmer_probe_map.

        These arrays are allocated using multiprocessing.sharedctypes.RawArray
        because the read/write synchronization (as offered by Array) is not
        needed.

        Args:
            keys: Contains the k-mers (keys) from kmer_probe_map, as strings,
                in sorted order. This is used for lookup. The same k-mer may
                appear multiple times if there are multiple probes that contain
                that k-mer (e.g., ['abc', 'def', 'def', 'ghi'] means that the
                k-mer 'def' appears at positions in two probes.
            probe_seqs_ind: For a k-mer keys[i], the value probe_seqs_ind[i]
                gives an index in the array probe_seqs whose value contains the
                sequence of a probe that contains the k-mer keys[i]. That is,
                the sequence probe_seqs[probe_seqs_ind[i]] contains the k-mer
                keys[i].
            probe_pos: Contains the position of k-mers in probes. A k-mer
                keys[i] appears at the position probe_pos[i] in the probe whose
                sequence is given by probe_seqs[probe_seqs_ind[i]].
            probe_seqs: The sequences of all the probes that appear in values
                in the kmer_probe_map. Note that there may be many k-mers/keys
                that map to the same probe; that probe's sequence appears just
                once in the probe_seqs array. If we were to make a direct
                mapping between indices in keys and indices in probe_seqs, we
                would have to store the same probe sequence many times.
            k: length of the k-mers (as an int) in keys
            probe_seqs_to_probe: dict mapping probe sequences (as strings)
                to the instances of probe.Probe from which these sequences
                came
            native_dict: kmer_probe_map as a native Python dict
        """
        self.keys = keys
        self.probe_seqs_ind = probe_seqs_ind
        self.probe_pos = probe_pos
        self.probe_seqs = probe_seqs
        self.k = k
        self.probe_seqs_to_probe = probe_seqs_to_probe
        self.native_dict = native_dict 
开发者ID:broadinstitute,项目名称:catch,代码行数:43,代码来源:probe.py

示例4: test_import

# 需要导入模块: import multiprocessing [as 别名]
# 或者: from multiprocessing import sharedctypes [as 别名]
def test_import(self):
        modules = self.get_module_names()
        if sys.platform == 'win32':
            modules.remove('multiprocessing.popen_fork')
            modules.remove('multiprocessing.popen_forkserver')
            modules.remove('multiprocessing.popen_spawn_posix')
        else:
            modules.remove('multiprocessing.popen_spawn_win32')
            if not HAS_REDUCTION:
                modules.remove('multiprocessing.popen_forkserver')

        if c_int is None:
            # This module requires _ctypes
            modules.remove('multiprocessing.sharedctypes')

        for name in modules:
            __import__(name)
            mod = sys.modules[name]
            self.assertTrue(hasattr(mod, '__all__'), name)

            for attr in mod.__all__:
                self.assertTrue(
                    hasattr(mod, attr),
                    '%r does not have attribute %r' % (mod, attr)
                    )

#
# Quick test that logging works -- does not test logging output
# 
开发者ID:Microvellum,项目名称:Fluid-Designer,代码行数:31,代码来源:_test_multiprocessing.py


注:本文中的multiprocessing.sharedctypes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。