Class CPythonPostProcessingScriptRunner

java.lang.Object
nz.org.riskscape.cpython.CPythonPostProcessingScriptRunner
All Implemented Interfaces:
nz.org.riskscape.engine.model.PostProcessingScriptRunner, nz.org.riskscape.engine.plugin.PluginFeature

public class CPythonPostProcessingScriptRunner extends Object implements nz.org.riskscape.engine.model.PostProcessingScriptRunner

Runs an optional Python script after a model run completes.

The script is called with a struct containing: - model_name: the name of the model - outputs: a list of {name, path} structs for each pipeline output - parameters: a list of {name, value} structs for each realization parameter

The script can register additional outputs via model_output().

  • Constructor Details

    • CPythonPostProcessingScriptRunner

      public CPythonPostProcessingScriptRunner(nz.org.riskscape.engine.Engine engine, CPythonSpawner spawner)
  • Method Details

    • buildMetadata

      public static Map<String,String> buildMetadata(String modelName, String parameters)

      Builds the metadata map for a model run.

      Parameters:
      modelName - the name of the model that ran
      parameters - the model parameters used for the run, formatted as a string
    • isSupported

      public boolean isSupported(URI scriptUri)
      Specified by:
      isSupported in interface nz.org.riskscape.engine.model.PostProcessingScriptRunner
    • build

      public nz.org.riskscape.engine.model.PostProcessingScript build(URI scriptUri)
      Specified by:
      build in interface nz.org.riskscape.engine.model.PostProcessingScriptRunner