module myna.core.components.component
Base class for workflow components
class Component
Base class for a workflow component
method Component.__init__
__init__()
method Component.apply_settings
apply_settings(step_settings, data_settings, myna_settings)
Update the step and data settings for the component from dictionaries
Args:
step_settings: a dictionary of settings related to the myna stepdata_settings: a dictionary of settings related to the build datamyna_settings: a dictionary of settings related to general Myna functionality
method Component.check_output_files
check_output_files(files)
Return whether a list of output files is valid for the component.
Args:
files: list of filepaths (strings) to check for validity
method Component.cmd_preformat
cmd_preformat(raw_cmd)
Replace placeholder names in command arguments and adds executable argument if a custom executable path is specified.
Args:
raw_cmd: a list of command arguments with (potential) placeholders
Available placeholders:
- {name}: the name of the component
- {build}: the name of the build associated with the workflow
- $MYNA_APP_PATH: the location of the app module in the myna install
- $MYNA_INSTALL_PATH: the location of the myna installation directory
method Component.get_files_from_template
get_files_from_template(template, abspath=True)
Get all possible input files associated with the component
Args:
template: string that will be used for the output file name for each caseabspath: boolean for using absolute path (True, default) or relative (False)
method Component.get_input_files
get_input_files(last_step_obj)
Return input file paths associated with the component.
Args:
last_step_obj: myna.components.component.Component object for the last step in the workflow
method Component.get_output_files
get_output_files(abspath=True)
Return output file paths associated with the component.
Args:
abspath: default True, boolean for using absolute (True) or relative (False) paths
method Component.get_step_args_list
get_step_args_list(operation)
Get the command list for the configure, execute, or postprocess operation that can be passed to subprocess.Popen
Args:
operation: "configure", "execute", or "postprocess"
Returns:
arglist: list of command arguments to be passed tosubprocess.Popen
method Component.run_component
run_component()
Runs the configure.py, execute.py, and postprocess.py for selected component class & application combination
method Component.sync_output_files
sync_output_files()
Sync valid output files back to the database
Sync behavior is defined in the myna.core.workflow.sync functions and in the myna.files.File subclasses associated with the Component input_requirement and output_requirement properties.
Returns:
synced_files: list of filepaths (strings) to the output files
This file was automatically generated via lazydocs.