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


Python DescriptorElementFactory.new_descriptor方法代码示例

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


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

示例1: test_no_params

# 需要导入模块: from smqtk.representation import DescriptorElementFactory [as 别名]
# 或者: from smqtk.representation.DescriptorElementFactory import new_descriptor [as 别名]
    def test_no_params(self, dei_init):
        # So we don't break python
        dei_init.return_value = None

        test_params = {}

        factory = DescriptorElementFactory(DummyElementImpl, test_params)

        expected_type = 'type'
        expected_uuid = 'uuid'
        # Should construct a new DEI instance under they hood somewhere
        r = factory.new_descriptor(expected_type, expected_uuid)

        ntools.assert_true(dei_init.called)
        dei_init.assert_called_once_with(expected_type, expected_uuid)
        ntools.assert_is_instance(r, DummyElementImpl)
开发者ID:kod3r,项目名称:SMQTK,代码行数:18,代码来源:test_DescriptorElementFactory.py

示例2: test_no_params

# 需要导入模块: from smqtk.representation import DescriptorElementFactory [as 别名]
# 或者: from smqtk.representation.DescriptorElementFactory import new_descriptor [as 别名]
    def test_no_params(self):
        test_params = {}

        factory = DescriptorElementFactory(DummyElementImpl, test_params)

        expected_type = 'type'
        expected_uuid = 'uuid'
        expected_args = ()
        expected_kwds = {}

        # Should construct a new DEI instance under they hood somewhere
        r = factory.new_descriptor(expected_type, expected_uuid)

        ntools.assert_is_instance(r, DummyElementImpl)
        ntools.assert_equal(r._type_label, expected_type)
        ntools.assert_equal(r._uuid, expected_uuid)
        ntools.assert_equal(r.args, expected_args)
        ntools.assert_equal(r.kwds, expected_kwds)
开发者ID:dhandeo,项目名称:SMQTK,代码行数:20,代码来源:test_DescriptorElementFactory.py

示例3: test_with_params

# 需要导入模块: from smqtk.representation import DescriptorElementFactory [as 别名]
# 或者: from smqtk.representation.DescriptorElementFactory import new_descriptor [as 别名]
    def test_with_params(self, dei_init):
        # So we don't break python
        dei_init.return_value = None

        v = numpy.random.randint(0, 10, 10)
        test_params = {
            'p1': 'some dir',
            'vec': v
        }

        factory = DescriptorElementFactory(DummyElementImpl, test_params)

        ex_type = 'type'
        ex_uuid = 'uuid'
        # Should construct a new DEI instance under they hood somewhere
        r = factory.new_descriptor(ex_type, ex_uuid)

        ntools.assert_true(dei_init.called)
        dei_init.assert_called_once_with(ex_type, ex_uuid, p1='some dir', vec=v)
        ntools.assert_is_instance(r, DummyElementImpl)
开发者ID:kod3r,项目名称:SMQTK,代码行数:22,代码来源:test_DescriptorElementFactory.py

示例4: test_with_params

# 需要导入模块: from smqtk.representation import DescriptorElementFactory [as 别名]
# 或者: from smqtk.representation.DescriptorElementFactory import new_descriptor [as 别名]
    def test_with_params(self):
        v = numpy.random.randint(0, 10, 10)
        test_params = {
            'p1': 'some dir',
            'vec': v
        }

        factory = DescriptorElementFactory(DummyElementImpl, test_params)

        ex_type = 'type'
        ex_uuid = 'uuid'
        ex_args = ()
        ex_kwds = test_params
        # Should construct a new DEI instance under they hood somewhere
        r = factory.new_descriptor(ex_type, ex_uuid)

        ntools.assert_is_instance(r, DummyElementImpl)
        ntools.assert_equal(r._type_label, ex_type)
        ntools.assert_equal(r._uuid, ex_uuid)
        ntools.assert_equal(r.args, ex_args)
        ntools.assert_equal(r.kwds, ex_kwds)
开发者ID:dhandeo,项目名称:SMQTK,代码行数:23,代码来源:test_DescriptorElementFactory.py


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