base
Base classes for describing Task parameters.
Classes:
Name | Description |
---|---|
AnalysisHeader |
Model holding shared configuration across Tasks. E.g. experiment name, run number and working directory. |
TaskParameters |
Base class for Task parameters. Subclasses specify a model of parameters and their types for validation. |
ThirdPartyParameters |
Base class for Third-party, binary executable Tasks. |
TemplateParameters |
Dataclass to represent parameters of binary (third-party) Tasks which are used for additional config files. |
TemplateConfig |
Class for holding information on where templates are stored in order to properly handle ThirdPartyParameter objects. |
AnalysisHeader
Bases: BaseModel
Header information for LUTE analysis runs.
Source code in lute/io/models/base.py
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 |
|
TaskParameters
Bases: BaseSettings
Base class for models of task parameters to be validated.
Parameters are read from a configuration YAML file and validated against subclasses of this type in order to ensure that both all parameters are present, and that the parameters are of the correct type.
Note
Pydantic is used for data validation. Pydantic does not perform "strict" validation by default. Parameter values may be cast to conform with the model specified by the subclass definition if it is possible to do so. Consider whether this may cause issues (e.g. if a float is cast to an int).
Source code in lute/io/models/base.py
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 |
|
Config
Configuration for parameters model.
The Config class holds Pydantic configuration. A number of LUTE-specific configuration has also been placed here.
Attributes:
Name | Type | Description |
---|---|---|
env_prefix |
str
|
Pydantic configuration. Will set parameters from
environment variables containing this prefix. E.g. a model
parameter |
underscore_attrs_are_private |
bool
|
Pydantic configuration. Whether to hide attributes (parameters) prefixed with an underscore. |
copy_on_model_validation |
str
|
Pydantic configuration. How to copy the input object passed to the class instance for model validation. Set to perform a deep copy. |
allow_inf_nan |
bool
|
Pydantic configuration. Whether to allow infinity or NAN in float fields. |
run_directory |
Optional[str]
|
None. If set, it should be a valid
path. The |
result_from_params |
Optional[str]
|
None. Optionally used to define
results from information available in the model using a custom
validator. E.g. use a |
result_summary |
Optional[str]
|
None. Defines a result summary that
can be known after processing the Pydantic model. Use of summary
depends on the Executor running the Task. All summaries are
stored in the database, however. Only used if |
Source code in lute/io/models/base.py
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 |
|
impl_schemas: Optional[str] = None
class-attribute
instance-attribute
Schema specification for output result. Will be passed to TaskResult.
result_from_params: Optional[str] = None
class-attribute
instance-attribute
Defines a result from the parameters. Use a validator to do so.
result_summary: Optional[str] = None
class-attribute
instance-attribute
Format a TaskResult.summary from output.
run_directory: Optional[str] = None
class-attribute
instance-attribute
Set the directory that the Task is run from.
set_result: bool = False
class-attribute
instance-attribute
Whether the Executor should mark a specified parameter as a result.
TemplateConfig
Bases: BaseModel
Parameters used for templating of third party configuration files.
Attributes:
Name | Type | Description |
---|---|---|
template_name |
str
|
The name of the template to use. This template must
live in |
output_path |
str
|
The FULL path, including filename to write the rendered template to. |
Source code in lute/io/models/base.py
313 314 315 316 317 318 319 320 321 322 323 324 325 |
|
TemplateParameters
Class for representing parameters for third party configuration files.
These parameters can represent arbitrary data types and are used in
conjunction with templates for modifying third party configuration files
from the single LUTE YAML. Due to the storage of arbitrary data types, and
the use of a template file, a single instance of this class can hold from a
single template variable to an entire configuration file. The data parsing
is done by jinja using the complementary template.
All data is stored in the single model variable params.
The pydantic "dataclass" is used over the BaseModel/Settings to allow
positional argument instantiation of the params
Field.
Source code in lute/io/models/base.py
188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 |
|
ThirdPartyParameters
Bases: TaskParameters
Base class for third party task parameters.
Contains special validators for extra arguments and handling of parameters used for filling in third party configuration files.
Source code in lute/io/models/base.py
207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 |
|
Config
Bases: Config
Configuration for parameters model.
The Config class holds Pydantic configuration and inherited configuration
from the base TaskParameters.Config
class. A number of values are also
overridden, and there are some specific configuration options to
ThirdPartyParameters. A full list of options (with TaskParameters options
repeated) is described below.
Attributes:
Name | Type | Description |
---|---|---|
env_prefix |
str
|
Pydantic configuration. Will set parameters from
environment variables containing this prefix. E.g. a model
parameter |
underscore_attrs_are_private |
bool
|
Pydantic configuration. Whether to hide attributes (parameters) prefixed with an underscore. |
copy_on_model_validation |
str
|
Pydantic configuration. How to copy the input object passed to the class instance for model validation. Set to perform a deep copy. |
allow_inf_nan |
bool
|
Pydantic configuration. Whether to allow infinity or NAN in float fields. |
run_directory |
Optional[str]
|
None. If set, it should be a valid
path. The |
result_from_params |
Optional[str]
|
None. Optionally used to define
results from information available in the model using a custom
validator. E.g. use a |
result_summary |
Optional[str]
|
None. Defines a result summary that can be known after processing the Pydantic model. Use of summary depends on the Executor running the Task. All summaries are stored in the database, however. |
ThirdPartyTask-specific |
Optional[str]
|
|
extra |
str
|
"allow". Pydantic configuration. Allow (or ignore) extra arguments. |
short_flags_use_eq |
bool
|
False. If True, "short" command-line args
are passed as |
long_flags_use_eq |
bool
|
False. If True, "long" command-line args
are passed as |
Source code in lute/io/models/base.py
214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 |
|
long_flags_use_eq: bool = False
class-attribute
instance-attribute
Whether long command-line arguments are passed like --long=arg
.
set_result: bool = True
class-attribute
instance-attribute
Whether the Executor should mark a specified parameter as a result.
short_flags_use_eq: bool = False
class-attribute
instance-attribute
Whether short command-line arguments are passed like -x=arg
.