hpcflow.app.Command#
- class hpcflow.app.Command(command=None, executable=None, arguments=None, variables=None, stdout=None, stderr=None, stdin=None, rules=<factory>)#
Bases:
Command
A command that may be run within a workflow action.
- Parameters:
command (str) – The actual command.
executable (str) – The executable to run, from the set of executable managed by the environment.
variables (dict[str, str]) – Values that may be substituted when preparing the arguments.
stdout (str) – The name of a file to write standard output to.
stderr (str) – The name of a file to write standard error to.
stdin (str) – The name of a file to read standard input from.
rules (list[ActionRule]) – Rules that state whether this command is eligible to run.
Methods
Make an instance of this class from JSON (or YAML) data.
Return the resolved command line.
Get whether stdout and stderr are workflow parameters.
Return executable labels required by this command.
Process a description of a standard stread from a command to get how it becomes a workflow parameter for later actions.
Serialize this object as a dictionary.
Serialize this object as an object structure that can be trivially converted to JSON.
Attributes
The arguments to pass in.
The actual command.
The executable to run, from the set of executable managed by the environment.
The name of a file to write standard error to.
The name of a file to read standard input from.
The name of a file to write standard output to.
Values that may be substituted when preparing the arguments.
Rules that state whether this command is eligible to run.
- command: str | None = None#
The actual command. Overrides
executable
.
- executable: str | None = None#
The executable to run, from the set of executable managed by the environment.
- classmethod from_json_like(json_like, shared_data=None)#
Make an instance of this class from JSON (or YAML) data.
- Parameters:
json_like (str | Mapping[str, JSONed] | Sequence[Mapping[str, JSONed]] | None) – The data to deserialise.
shared_data (Mapping[str, ObjectList[JSONable]] | None) – Shared context data.
- Return type:
The deserialised object.
- get_command_line(EAR, shell, env)#
Return the resolved command line.
This is ordinarily called at run-time by Workflow.write_commands.
- Parameters:
EAR (ElementActionRun) –
shell (Shell) –
env (Environment) –
- Return type:
- get_output_types()#
Get whether stdout and stderr are workflow parameters.
- get_required_executables()#
Return executable labels required by this command.
- Return type:
Sequence[str]
- process_std_stream(name, value, stderr)#
Process a description of a standard stread from a command to get how it becomes a workflow parameter for later actions.
- rules: list[ActionRule]#
Rules that state whether this command is eligible to run.
- to_json_like(dct=None, shared_data=None, exclude=(), path=None)#
Serialize this object as an object structure that can be trivially converted to JSON. Note that YAML can also be produced from the result of this method; it just requires a different final serialization step.