-
Notifications
You must be signed in to change notification settings - Fork 4
DuckTape Module Creation
Wongiseng edited this page Oct 9, 2013
·
5 revisions
Module is the basic computational unit that can be composed in DuckTape workflow.
Give example on how to convert existing java into module
Give example how to convert existing command line into module
#Java Domain
To define DuckTape module based on existing Java class, we can use annotation. The class which we wanted to use as module needs to be annotated with @Module annotation.
To identify inputs to a module, we can use annotation to mark a class field or a function parameter as an input of a module.
###Input Annotation on constructors
@Module(name="LibLINEARParms")
public class LibLINEARParmsModule {
public LibLINEARParmsModule(
@In(name="cs") List<Double> cs,
@In(name="nrFolds") int folds,
@In(name="target") List<Double> target
) {
cv = true;
this.cs = cs;
this.target = target;
this.nrFolds = folds;
}
}
###Input annotation on fields @Module(name="Adder", description="Adds two numbers together.") public class AdderModule { @In(name="first") public Integer first; @In(name="second") public Integer second }