New Product Generation Plugin (--prod)#
For the purposes of this tutorial, I will assume you are creating a new
Plugin shinyrock for processing Processed Output Data files
to create some kind of unique deliverable. Before we begin, see
Stage 4 Dataflow to get a brief overview of how data flows
through the pipeline w.r.t. stage 4, and Plugin Development Guide for a
general overview of creating a new plugin.
To begin, create the following filesystem structure in
$HOME/git/plugins/shinyrock.
plugin.py- This file is required, and is where most of the bits for theplugin will go. You don't have to call it this; if you want to use a different name, see Schemas for options.
cmdline.pyThis file is optional. If your new plugin doesn't need any additional cmdline arguments, you can skip it.
These files will be populated as you go through the rest of the tutorial.
Create additional cmdline arguments for the new engine by following Extending the SIERRA Cmdline For Your Plugin.
Create the following filesystem structure in
$HOME/git/plugins/shinyrock:Within this file, you must define the following functions, which must be named EXACTLY as specified, otherwise SIERRA will not detect them.
from sierra.core import types, batchroot import sierra.core.variables.batch_criteria as bc def proc_batch_exp( main_config: types.YAMLDict, cmdopts: types.Cmdopts, pathset: batchroot.PathSet, criteria: bc.XVarBatchCriteria, ) -> None: """Generate products results for all experiments in the batch experiment. Can be serially or in parallel. Processing should respect ``--processing-parallelism`` and ``--exp-range``. """
Put
$HOME/git/pluginson yourSIERRA_PLUGIN_PATH. Then your plugin can be selected as--proc=plugins.shinyrock.