zoon icon indicating copy to clipboard operation
zoon copied to clipboard

Facilitating meta-modules

Open goldingn opened this issue 9 years ago • 3 comments

Enabling module developers to create modules which combine other modules in a Chain would make it possible to compare different procedures (by listing different meta modules), to share sections of complete analyses, and should be fairly easy to implement.

At present module devs could always do:

MyMetaModule <- function(x, y)
  LoadModule(a)
  LoadModule(b)
  LoadModule(c)

  ans <- a(x, y)
  ans <- b(ans$x, ans$y, someoptions = 'blah')
  ans <- c(ans$x, ans$y)
  return (ans)
}

but that's ugly and would dump stuff to the global environment (unless we implemented child processes as in #84). A neater (and more consistent with the workflow interface) syntax would be something like:

MyMetaModule <- function(.x, .y)
  Chain(a(.x, .y),
        b(.x, .y, someoptions = 'blah'),
        c(.x, .y))
}

Although we'd have to hack Chain to run these sequentially.

What do you think of this approach and interface?

goldingn avatar Sep 21 '15 12:09 goldingn

@goldingn I don't follow the purpose of this? can you give a laymen example?

AugustT avatar Sep 29 '15 08:09 AugustT

Dont worry I see what you mean from the scrubr module suggestion.

AugustT avatar Sep 29 '15 09:09 AugustT

:+1:

goldingn avatar Sep 29 '15 09:09 goldingn