Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

  1. Create the script mentioned in the chimera_config.yaml file under the preprocessor.module_path.

  2. In the script, declare the subclass mentioned in the chimera_config.yaml file under the preprocessor.class_name

  3. Start with the following code snippet:

    # import the parent class from chimera
    from chimera.precondition_functions import PreConditionFunctions
    
    # declare the sub class
    class <class_name>(PreConditionFunctions):
        def __init__(self, context, pge_config, settings, job_params):
            PreConditionFunctions.__init__(self, context, pge_config, settings, job_params)

    The variables you have available throughout this subclass are:

    • Context - contents of _context.json of the SciFlo job. You can access it as self._context in the precondition functions

    • PGE’s configuration - contents of the respective PGE’s configuration file. Can be accessed as self._pge_config

    • Settings file - content of settings.yaml file accessible as self._settings

    • Job Params - This is a dictionary that stores all the information gathered during preconditions evaluation. How to utilize it will be described soon. It can be accessed as self._job_params

  • No labels