models
Models for job management.
This module defines data classes for various job management settings and results.
RunInstance
dataclass
Represents a single instance of a computational run, storing relevant data and metadata associated with the run.
Attributes:
| Name | Type | Description |
|---|---|---|
run_location |
str
|
The directory where the run will be executed. |
id |
str
|
The identifier for a run instance. |
command |
str
|
The executable command to run (optional). |
args |
List[str]
|
The arguments to pass to the command (optional). |
Methods:
| Name | Description |
|---|---|
to_dict |
Converts the RunInstance object into a JSON-serializable dictionary. |
get_command_with_args |
Returns the command and arguments for execution. |
Source code in src/mada_tools/simulation/simutils/models.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 | |
__repr__()
Returns a detailed string representation of the RunInstance object for debugging.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
A detailed string representation of the object. |
Source code in src/mada_tools/simulation/simutils/models.py
__str__()
Returns a human-readable string representation of the RunInstance object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
A string describing the run instance. |
Source code in src/mada_tools/simulation/simutils/models.py
from_dict(data)
classmethod
Creates a RunInstance object from a dictionary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
Dict
|
Dictionary containing run instance data |
required |
Returns:
| Type | Description |
|---|---|
RunInstance
|
RunInstance object with data from the dictionary |
Source code in src/mada_tools/simulation/simutils/models.py
get_command_with_args()
Returns the command and arguments for execution.
Returns:
| Type | Description |
|---|---|
Tuple[str, List[str]]
|
Tuple[str, List[str]]: The command and its arguments. |
Source code in src/mada_tools/simulation/simutils/models.py
get_run_command()
Constructs the shell command to execute this run instance.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
The shell command to execute this run. |
Source code in src/mada_tools/simulation/simutils/models.py
to_dict()
Converts the RunInstance object into a JSON-serializable dictionary.
Returns:
| Type | Description |
|---|---|
Dict
|
A dictionary representation of the RunInstance object. |
Source code in src/mada_tools/simulation/simutils/models.py
SampleOutputResult
dataclass
Represents the result of sample output generation, storing the output path, output type, and optionally the run instances (if necessary).
Attributes:
| Name | Type | Description |
|---|---|---|
output_path |
str
|
The path where the samples are written. For "csv" output, this is the path to the CSV file. For "folder" output, this is the path to the directory. |
output_type |
str
|
The type of output generated (e.g., "csv", "folder"). |
run_instances |
List[RunInstance]
|
A list of RunInstance objects if the output type is "folder". |
Source code in src/mada_tools/simulation/simutils/models.py
__repr__()
Returns a detailed string representation of the SampleOutputResult object for debugging.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
A detailed string representation of the object. |
Source code in src/mada_tools/simulation/simutils/models.py
__str__()
Returns a human-readable string representation of the SampleOutputResult object.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
A string describing the sample output result. |