hyfi.task
BatchPath
Bases: TaskPath
Source code in hyfi/path/batch.py
batch_dir: Path
property
Returns the path to the batch directory.
workspace_dir: Path
property
Returns the path to the task root directory.
Returns:
Type | Description |
---|---|
Path
|
an path to the task root directory or None if it doesn't exist or cannot be converted to a path object |
BatchTask
Bases: Task
Configuration class for batch tasks. Inherits from TaskConfig.
Attributes:
Name | Type | Description |
---|---|---|
_config_name_ |
str
|
The name of the configuration. |
_config_group_ |
str
|
The configuration group. |
batch_name |
str
|
The name of the batch. |
batch |
BatchConfig
|
The batch configuration. |
_property_set_methods_ |
Dict[str, str]
|
A dictionary of property set methods. |
Source code in hyfi/task/batch.py
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 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 |
|
load_config(batch_name=None, batch_num=None, filepath=None, **config_kwargs)
Load the config from the batch config file
Source code in hyfi/task/batch.py
save_config(filepath=None, exclude=None, exclude_none=True, only_include=None, save_as_json_as_well=True)
Save the batch configuration to file.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
filepath
|
Optional[Union[str, Path]]
|
The filepath to save the configuration to. Defaults to None. |
None
|
exclude
|
Optional[Union[str, List[str], Set[str], None]]
|
Keys to exclude from the saved configuration. Defaults to None. |
None
|
exclude_none
|
bool
|
Whether to exclude keys with None values from the saved configuration. Defaults to True. |
True
|
only_include
|
Optional[Union[str, List[str], Set[str], None]]
|
Keys to include in the saved configuration. Defaults to None. |
None
|
save_as_json_as_well
|
bool
|
Whether to save the configuration as a json file as well. Defaults to True. |
True
|
Returns:
Name | Type | Description |
---|---|---|
str |
str
|
The filename of the saved configuration. |
Source code in hyfi/task/batch.py
Task
Bases: BaseConfig
Source code in hyfi/task/task.py
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 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 |
|
get_pipelines()
Get the list of pipelines for a task
Parameters:
Name | Type | Description | Default |
---|---|---|---|
task
|
The task to get the pipelines for |
required |
Returns:
Type | Description |
---|---|
Pipelines
|
A list of PipelineConfig objects |
Source code in hyfi/task/task.py
load_modules()
Load the modules
Source code in hyfi/task/task.py
reset(objects=None, release_gpu_memory=True)
Reset the memory cache
run(pipelines=None)
Run pipelines specified in the task
Parameters:
Name | Type | Description | Default |
---|---|---|---|
pipelines
|
Optional[Pipelines]
|
The pipelines to run |
None
|
Source code in hyfi/task/task.py
run_pipeline(pipeline, initial_object=None)
Run a pipeline given a config
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config
|
PipelineConfig to run the pipeline |
required | |
initial_obj
|
Object to use as initial value |
required | |
task
|
TaskConfig to use as task |
required |
Returns:
Type | Description |
---|---|
Any
|
The result of the pipeline |
Source code in hyfi/task/task.py
TaskPath
Bases: BasePath
Source code in hyfi/path/task.py
name: str
property
Returns the name of the path configuration.
root_dir: Path
property
Returns the path to the task root directory.
Returns:
Type | Description |
---|---|
Path
|
an path to the task root directory or None if it doesn't exist or cannot be converted to a path object |
task_dir: Path
property
Returns the path to the task root directory.
Returns:
Type | Description |
---|---|
Path
|
an path to the task root directory or None if it doesn't exist or cannot be converted to a path object |
workspace_dir: Path
property
Returns the path to the task root directory.
Returns:
Type | Description |
---|---|
Path
|
an path to the task root directory or None if it doesn't exist or cannot be converted to a path object |