• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python vistrails_module.Module类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中vistrails.core.modules.vistrails_module.Module的典型用法代码示例。如果您正苦于以下问题:Python Module类的具体用法?Python Module怎么用?Python Module使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: __init__

    def __init__(self):
        """ SpreadsheetCell() -> SpreadsheetCell
        Initialize attributes

        """
        Module.__init__(self)
        self.location = None
开发者ID:AnyarInc,项目名称:VisTrails,代码行数:7,代码来源:basic_widgets.py


示例2: __init__

 def __init__(self):
     """ SheetReference() -> SheetReference
     Instantiate an empty SheetReference
     
     """
     Module.__init__(self)
     self.sheetReference = None
开发者ID:cjh1,项目名称:VisTrails,代码行数:7,代码来源:basic_widgets.py


示例3: __init__

 def __init__(self):
     """ vtkBaseModule() -> vtkBaseModule
     Instantiate an emptt VTK Module with real VTK instance
     
     """
     Module.__init__(self)
     self.vtkInstance = None
开发者ID:cjh1,项目名称:VisTrails,代码行数:7,代码来源:base_module.py


示例4: transfer_attrs

 def transfer_attrs(self, module):
     self.pipeline = module.pipeline
     if module._port_specs is None:
         module.make_port_specs()
     self.input_remap = module._input_remap
     self.output_remap = module._output_remap
     Module.transfer_attrs(self, module)
开发者ID:AnyarInc,项目名称:VisTrails,代码行数:7,代码来源:sub_module.py


示例5: __init__

 def __init__(self):
     Module.__init__(self)
     self.locator = None
     self.version = -1
     self.pipeline = None
     self.execute = False
     self.embedWorkflow = False
     self.showSpreadsheetOnly = False
     self.forceDB = False
开发者ID:lumig242,项目名称:VisTrailsRecommendation,代码行数:9,代码来源:init.py


示例6: clear

 def clear(self):
     """ clear() -> None
     Remove event handler so the object can be freed correctly
     
     """
     # Remove all observers
     if self.observer:
         for e in vtkInteractionHandler.vtkEvents:
             self.observer.vtkInstance.RemoveObservers(e)
     Module.clear(self)
开发者ID:lumig242,项目名称:VisTrailsRecommendation,代码行数:10,代码来源:vtkhandler.py


示例7: mock_get_input

 def mock_get_input(self, name):
     if name == 'host':
         return host
     elif name == 'port':
         return port
     else:
         return Module.get_input(self, name)
开发者ID:AnyarInc,项目名称:VisTrails,代码行数:7,代码来源:init.py


示例8: __init__

    def __init__(self):
        Module.__init__(self)

        config = get_vistrails_persistent_configuration()
        if config.check('webRepositoryURL'):
            self.base_url = config.webRepositoryURL
        else:
            raise ModuleError(self,
                              ("No webRepositoryURL value defined"
                               " in the Expert Configuration"))

        # check if we are running in server mode
        # this effects how the compute method functions
        if config.check('isInServerMode'):
            self.is_server = bool(config.isInServerMode)
        else:
            self.is_server = False

        # TODO: this '/' check should probably be done in core/configuration.py
        if self.base_url[-1] == '/':
            self.base_url = self.base_url[:-1]
开发者ID:AnyarInc,项目名称:VisTrails,代码行数:21,代码来源:init.py


示例9: __init__

 def __init__(self):
     Module.__init__(self)
     self.input_ports_order = []
     self.output_ports_order = []
开发者ID:sguzwf,项目名称:VisTrails,代码行数:4,代码来源:init.py


示例10: transfer_attrs

 def transfer_attrs(self, module):
     Module.transfer_attrs(self, module)
     self.input_ports_order = [p.name for p in module.input_port_specs]
     self.output_ports_order = [p.name for p in module.output_port_specs
                                if p.name in module.connected_output_ports]
开发者ID:sguzwf,项目名称:VisTrails,代码行数:5,代码来源:init.py


示例11: setResult

 def setResult(self, port_name, value):
     if value is not None and port_name == "value":
         if value.name is None:
             value.name = self.forceGetInputFromPort("name", None)
     Module.setResult(self, port_name, value)
开发者ID:remram44,项目名称:tabledata-backport,代码行数:5,代码来源:common.py


示例12: updateUpstream

 def updateUpstream(self):
     if self.figInstance is None:
         self.figInstance = pylab.figure()
     pylab.hold(True)
     Module.updateUpstream(self)
开发者ID:lumig242,项目名称:VisTrailsRecommendation,代码行数:5,代码来源:bases.py


示例13: __init__

 def __init__(self):
     Module.__init__(self)
     self.qgis_obj = None
开发者ID:Nikea,项目名称:VisTrails,代码行数:3,代码来源:init.py


示例14: __init__

 def __init__(self):
     Module.__init__(self)
     self.figInstance = None
开发者ID:tacaswell,项目名称:VisTrails,代码行数:3,代码来源:bases.py


示例15: __init__

 def __init__(self, pattern, constraints=None):
     Module.__init__(self)
     self.pattern = pattern
     self.constraints = constraints
开发者ID:ScottWales,项目名称:cwsl-mas,代码行数:4,代码来源:drs_dataset.py


示例16: set_output

 def set_output(self, port_name, value):
     if self.list_depth == 0 and value is not None and port_name == 'value':
         if value.name is None:
             value.name = self.force_get_input('name', None)
     Module.set_output(self, port_name, value)
开发者ID:hjanime,项目名称:VisTrails,代码行数:5,代码来源:common.py


示例17: __init__

 def __init__(self):
     AssembleDirectoryMixin.__init__(self)
     Module.__init__(self)
开发者ID:AnyarInc,项目名称:VisTrails,代码行数:3,代码来源:init.py


示例18: __init__

 def __init__(self):
     Module.__init__(self)
     self.is_group = True
     self.persistent_modules = []
开发者ID:AnyarInc,项目名称:VisTrails,代码行数:4,代码来源:sub_module.py


示例19: execute

def execute(modules, connections=[], add_port_specs=[],
            enable_pkg=True, full_results=False):
    """Build a pipeline and execute it.

    This is useful to simply build a pipeline in a test case, and run it. When
    doing that, intercept_result() can be used to check the results of each
    module.

    modules is a list of module tuples describing the modules to be created,
    with the following format:
        [('ModuleName', 'package.identifier', [
            # Functions
            ('port_name', [
                # Function parameters
                ('Signature', 'value-as-string'),
            ]),
        ])]

    connections is a list of tuples describing the connections to make, with
    the following format:
        [
            (source_module_index, 'source_port_name',
             dest_module_index, 'dest_module_name'),
         ]

    add_port_specs is a list of specs to add to modules, with the following
    format:
        [
            (mod_id, 'input'/'output', 'portname',
             '(port_sig)'),
        ]
    It is useful to test modules that can have custom ports through a
    configuration widget.

    The function returns the 'errors' dict it gets from the interpreter, so you
    should use a construct like self.assertFalse(execute(...)) if the execution
    is not supposed to fail.


    For example, this creates (and runs) an Integer module with its value set
    to 44, connected to a PythonCalc module, connected to a StandardOutput:

    self.assertFalse(execute([
            ('Float', 'org.vistrails.vistrails.basic', [
                ('value', [('Float', '44.0')]),
            ]),
            ('PythonCalc', 'org.vistrails.vistrails.pythoncalc', [
                ('value2', [('Float', '2.0')]),
                ('op', [('String', '-')]),
            ]),
            ('StandardOutput', 'org.vistrails.vistrails.basic', []),
        ],
        [
            (0, 'value', 1, 'value1'),
            (1, 'value', 2, 'value'),
        ]))
    """
    from vistrails.core.db.locator import XMLFileLocator
    from vistrails.core.modules.module_registry import MissingPackage
    from vistrails.core.packagemanager import get_package_manager
    from vistrails.core.utils import DummyView
    from vistrails.core.vistrail.connection import Connection
    from vistrails.core.vistrail.module import Module
    from vistrails.core.vistrail.module_function import ModuleFunction
    from vistrails.core.vistrail.module_param import ModuleParam
    from vistrails.core.vistrail.pipeline import Pipeline
    from vistrails.core.vistrail.port import Port
    from vistrails.core.vistrail.port_spec import PortSpec
    from vistrails.core.interpreter.noncached import Interpreter

    pm = get_package_manager()

    port_spec_per_module = {} # mod_id -> [portspec: PortSpec]
    j = 0
    for i, (mod_id, inout, name, sig) in enumerate(add_port_specs):
        mod_specs = port_spec_per_module.setdefault(mod_id, [])
        ps = PortSpec(id=i,
                      name=name,
                      type=inout,
                      sigstring=sig,
                      sort_key=-1)
        for psi in ps.port_spec_items:
            psi.id = j
            j += 1
        mod_specs.append(ps)

    pipeline = Pipeline()
    module_list = []
    for i, (name, identifier, functions) in enumerate(modules):
        function_list = []
        try:
            pkg = pm.get_package(identifier)
        except MissingPackage:
            if not enable_pkg:
                raise
            pkg = pm.identifier_is_available(identifier)
            if pkg:
                pm.late_enable_package(pkg.codepath)
                pkg = pm.get_package(identifier)

#.........这里部分代码省略.........
开发者ID:cjh1,项目名称:VisTrails,代码行数:101,代码来源:utils.py


示例20: __init__

 def __init__(self):
     Module.__init__(self)
     self.observer = None
     self.handler = None
     self.shareddata = None
开发者ID:lumig242,项目名称:VisTrailsRecommendation,代码行数:5,代码来源:vtkhandler.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap