matflow.Action#
- class matflow.Action(environments=None, commands=None, script=None, script_data_in=None, script_data_out=None, script_data_files_use_opt=False, script_exe=None, script_pass_env_spec=False, abortable=False, input_file_generators=None, output_file_parsers=None, input_files=None, output_files=None, rules=None, save_files=None, clean_up=None)#
Bases:
Action
Methods
Generate the file contents of this source.
Generate the data index for this action of an element iteration whose overall data index is passed.
Get input files types from commands.
Get parameter types from commands.
Get parameter types from command stdout and stderr arguments.
Get the input types that are consumed by commands and input file generators of this action.
Get the output types that are produced by command standard outputs and errors, and by output file parsers of this action.
Find if/where a given parameter is used by the action.
Get parameter types associated with a given prefix.
Get the action scopes that are inclusive of this action, ordered by decreasing specificity.
Return executable labels required by this action.
Return the script name.
Returns True if the provided script string represents a script snippets that is to be modified before execution (e.g.
Test all rules against the specified element iteration.
Attributes
Get input parameter types by script data-in format.
Return True if the script requires some inputs to be passed directly from the app.
Return True if the script requires some inputs to be passed via an intermediate file format.
Get output parameter types by script data-out format.
Return True if the script produces some outputs to be passed directly to the app.
Return True if the script produces some outputs via an intermediate file format.
Return True if the script is a Python script (determined by the file extension)
- Parameters:
environments (Optional[List[app.ActionEnvironment]]) –
commands (Optional[List[app.Command]]) –
script (Optional[str]) –
script_data_in (Optional[str]) –
script_data_out (Optional[str]) –
script_data_files_use_opt (Optional[bool]) –
script_exe (Optional[str]) –
script_pass_env_spec (Optional[bool]) –
abortable (Optional[bool]) –
input_file_generators (Optional[List[app.InputFileGenerator]]) –
output_file_parsers (Optional[List[app.OutputFileParser]]) –
input_files (Optional[List[app.FileSpec]]) –
output_files (Optional[List[app.FileSpec]]) –
rules (Optional[List[app.ActionRule]]) –
save_files (Optional[List[str]]) –
clean_up (Optional[List[str]]) –
- app = App(name='MatFlow', version='0.3.0a129')#
- compose_source(snip_path)#
Generate the file contents of this source.
- expand()#
- classmethod from_json_like(json_like, shared_data=None)#
- Parameters:
json_like (Union[Dict, List]) –
shared_data (Optional[Dict[str, ObjectList]]) –
- generate_data_index(act_idx, EAR_ID, schema_data_idx, all_data_idx, workflow, param_source)#
Generate the data index for this action of an element iteration whose overall data index is passed.
This mutates all_data_idx.
- get_command_input_types(sub_parameters=False)#
Get parameter types from commands.
- get_command_output_types()#
Get parameter types from command stdout and stderr arguments.
- get_commands_action_env()#
- get_environment()#
- Return type:
- get_input_file_generator_action_env(input_file_generator)#
- Parameters:
input_file_generator (InputFileGenerator) –
- get_input_file_labels()#
- get_input_types(sub_parameters=False)#
Get the input types that are consumed by commands and input file generators of this action.
- get_output_file_labels()#
- get_output_file_parser_action_env(output_file_parser)#
- Parameters:
output_file_parser (OutputFileParser) –
- get_output_types()#
Get the output types that are produced by command standard outputs and errors, and by output file parsers of this action.
- get_parameter_dependence(parameter)#
Find if/where a given parameter is used by the action.
- Parameters:
parameter (SchemaParameter) –
- get_parameter_names(prefix)#
Get parameter types associated with a given prefix.
For example, with the prefix “inputs”, this would return [‘p1’, ‘p2’] for an action that has input types p1 and p2. For inputs, labels are ignored. For example, for an action that accepts two inputs of the same type p1, with labels one and two, this method would return (for the “inputs” prefix): [‘p1[one]’, ‘p1[two]’].
This method is distinct from TaskSchema.get_parameter_names in that it returns action-level input/output/file types/labels, whereas TaskSchema.get_parameter_names returns schema-level inputs/outputs.
- get_possible_scopes()#
Get the action scopes that are inclusive of this action, ordered by decreasing specificity.
- Return type:
- get_precise_scope()#
- Return type:
- get_required_executables()#
Return executable labels required by this action.
- get_resolved_action_env(relevant_scopes, input_file_generator=None, output_file_parser=None, commands=None)#
- Parameters:
relevant_scopes (Tuple[ActionScopeType]) –
input_file_generator (InputFileGenerator) –
output_file_parser (OutputFileParser) –
- classmethod get_script_name(script)#
Return the script name.
- classmethod get_snippet_script_path(script_path, env_spec=None)#
- classmethod get_snippet_script_str(script, env_spec=None)#
- is_input_type_required(typ, provided_files)#
- static is_snippet_script(script)#
Returns True if the provided script string represents a script snippets that is to be modified before execution (e.g. to receive and provide parameter data).
- process_script_data_formats()#
- property script_data_in_grouped: Dict[str, List[str]]#
Get input parameter types by script data-in format.
- property script_data_in_has_direct: bool#
Return True if the script requires some inputs to be passed directly from the app.
- property script_data_in_has_files: bool#
Return True if the script requires some inputs to be passed via an intermediate file format.
- property script_data_out_grouped: Dict[str, List[str]]#
Get output parameter types by script data-out format.
- property script_data_out_has_direct: bool#
Return True if the script produces some outputs to be passed directly to the app.
- property script_data_out_has_files: bool#
Return True if the script produces some outputs via an intermediate file format.
- property script_is_python: bool#
Return True if the script is a Python script (determined by the file extension)
- property task_schema#
- test_rules(element_iter)#
Test all rules against the specified element iteration.
- to_dict()#
- to_json_like(dct=None, shared_data=None, exclude=None, path=None)#