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 executableexecute_command (
Union
[List
[str
],str
]) – List of command-line arguments, where each is formatted using the instance of the class asself
. 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 fileextra_inputs (
Optional
[List
[Union
[str
,bytes
,PathLike
]]]) – Extra (non-templated) input filesextra_template_inputs (
Optional
[List
[Union
[str
,bytes
,PathLike
]]]) – Extra templated input filesplugin_name (
str
) – Name of the pluginshow_stdout (
bool
) – Whether to display output from stdout when \(run\) is calledshow_stderr (
bool
) – Whether to display output from stderr whenrun()
is calledunit_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