watts.PluginGeneric#

class watts.PluginGeneric(executable, execute_command, template_file, extra_inputs=None, extra_template_inputs=None, plugin_name='Generic', show_stdout=False, show_stderr=False, unit_system='si')[source]#

Plugin that relies on generating a template file

This class can be used to control the execution of an arbitrary executable, first rendering one or more templated input files.

Parameters:
  • executable (Union[str, bytes, PathLike]) – Path to executable

  • execute_command (Union[List[str], str]) – List of command-line arguments, where each is formatted using the instance of the class as self. The first string normally indicates the executable, i.e. “{self.executable}”. The rendered input file can be accessed as “{self.input_name}”. A single string of command-line arguments is also accepted.

  • template_file (Union[str, bytes, PathLike]) – Path to template file

  • extra_inputs (Optional[List[Union[str, bytes, PathLike]]]) – Extra (non-templated) input files

  • extra_template_inputs (Optional[List[Union[str, bytes, PathLike]]]) – Extra templated input files

  • plugin_name (str) – Name of the plugin

  • show_stdout (bool) – Whether to display output from stdout when \(run\) is called

  • show_stderr (bool) – Whether to display output from stderr when run() is called

  • unit_system ({'si', 'cgs'}) – Unit system to convert to when rendering input files

executable#

Path to plugin executable

execute_command#

List of command-line arguments used to call the executable

Methods

postrun(params, exec_info, **kwargs)

Read simulation results and create results object

prerun(params[, filename])

Render the template based on model parameters

run([mpi_args, extra_args])

Run plugin