module: Create a 'module' object

Description Usage Arguments Details Value See Also Examples

Description

Creates a module object which can be executed in conduit.

Usage

1
2
module(name, language, host = NULL, description = NULL, inputs = NULL,
  outputs = NULL, sources = NULL, location = getwd())

Arguments

name

Name of module

language

moduleLanguage object describing source script execution language

host

moduleHost object describing machine where module is to be executed

description

A basic description of the module

inputs

List of moduleInput objects

outputs

List of moduleOutput objects

sources

List of moduleSource objects

location

file directory where module xml and files are found

Details

inputs, outputs, and sources should be lists of objects created using moduleInput, moduleOutput, and moduleSource respectively.

Module location defaults to current working directory. This can be set to indicate the location of the module XML file, and its supporting files.

If moduleHost is not provided module will be executed on local machine.

Value

module list containing:

name

module name

language

moduleLanguage object

host

moduleHost object

description

module description

inputs

list of moduleInput objects

outputs

list of moduleOutput objects

sources

list of moduleSource objects

See Also

moduleInput, moduleOutput and moduleSource for creating objects for these lists. loadModule for reading a module from an XML file. saveModule for saving a module as an XML file. runModule for executing a module's source scripts.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
## create a module with one output and one source
src1 <- moduleSource(vessel = scriptVessel(value = "x <- \"set\""))
outp1 <- moduleOutput(
             name = "x",
             internalVessel(symbol = "x"),
             format = ioFormat("R character string"))
mod1 <- module(name = "setX", language = moduleLanguage("R"),
               description = "sets the value of x",
               outputs = list(outp1),
               sources = list(src1))

## create a module with one input and one source
mod2 <-
    module(
        "showY",
        language = moduleLanguage("R"),
        description = "displays the value of Y",
        inputs =
            list(
                moduleInput(
                    name = "y",
                    vessel = internalVessel(symbol = "y"),
                    format = ioFormat("R character string"))),
        sources =
            list(
                moduleSource(
                scriptVessel(value = "print(y)"))))

anhinton/conduit documentation built on May 10, 2019, 11:48 a.m.