Application development

This section describes what developers need to do to write a new class that can be used as an Application Drop in DALiuGE.

Class

Developers need to write a new python class that derives from the dlg.drop.BarrierAppDROP class. This base class defines all methods and attributes that derived class need to function correctly. This new class will need a single method called run, that receives no arguments, and executes the logic of the application.

I/O

An application’s input and output drops are accessed through its inputs and outputs members. Both of these are lists of drops, and will be sorted in the same order in which inputs and outputs were defined in the Logical Graph. Each element can also be queried for its uid.

Data can be read from input drops, and written in output drops. To read data from an input drop, one calls first the drop’s open method, which returns a descriptor to the opened drop. Using this descriptor one can perform successive calls to read, which will return the data stored in the drop. Finally, the drop’s close method should be called to ensure that all internal resources are freed.

Writing data into an output drop is similar but simpler. Application authors need only call one or more times the write method with the data that needs to be written.