Skip to content
Damien Irving edited this page May 16, 2015 · 6 revisions

If you'd like to add your own module to the plugin, follow this 4 (or 5) step process:

  1. Write a script (in any programming language) that is able to be executed from the command line. The positional arguments required by this script should be an input file name and output file name, as well as any other positional and/or keyword arguments that you'd like.

  2. Store that script in an appropriate directory of your forked version of the cwsl-ctools repository.

  3. Write a python wrapper for your script and store it in your forked version of cwsl-mas/cwsl/vt_modules/. This wrapper tells VisTrails how to deal with the various inputs and outputs of your script.

  • The easiest way to do this is to copy an existing wrapper at cwsl-mas/cwsl/vt_modules/ and simply change the relevant sections to reflect the specifics of your module.
  1. Register your wrapper in cwsl-mas/cwsl/init.py.

  2. If you think your module might be of interest to the wider community, make all these changes to your forked repositories on a new branch. Once you're done, you can then submit a pull request to have your module included in the main cwsl-ctools and cwsl-mas repositories. You may also wish to submit an example workflow to the cwsl-workflows repository so others can see your module in action.

Principles of module design

Workflow modules are most useful when their scope is limited to a single discrete task, because that makes them easy to mix and match with other modules. For instance, let's say you want to calculate the average value over a two dimensional latitude/longitude box. You could write a module that extracts the region and then takes the average (i.e. two tasks at once), however it's hard to adapt that module to slightly different tasks. In future you might need to calculate the average over three dimensions (e.g. latitude/longitude/depth), which means you'd have to write a whole new script. A better approach would have been to write two separate modules for the first task (one for extracting the latitude/longitude box and one for calculating the spatial average), then all you'd have to do for the three dimensional problem is insert an extra little module into the workflow for sub-setting a dataset based on depth/altitude.

Clone this wiki locally