parameters
Module for LUTE parameter objects.
This module contains objects that define LUTE TaskParameters. It is separate
from the pydantic model definitions included in lute.io.models. This allows
LUTE first-party code to run without pydantic validation. Validation is still
required to have occurred at some point to enter correct values into the database.
AnalysisHeader
Bases: ContainerBase
Header information for LUTE analysis runs.
Source code in lute/io/parameters.py
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 | |
ParameterConfig
Bases: ContainerBase
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 |
|---|---|---|
version_specifier |
Optional[int]
|
An indicator of how to interpret the version information. An integer constructed from enumerators of the VersionSpecifier enum (lute.tasks.dataclasses), or a bitwise OR thereof. If None, no version information available. |
task_version |
Optional[str]
|
The version information. This field may be filled dynamically. Interpretation of the information (if present) is determined by the version_specifier. It may be, e.g. a JSON string containing a git commit hash, a git diff, a straight version string (v2, e.g.). |
version_location |
Optional[str]
|
None. Indicate where the version info should be taken from. E.g. a repository. Can be filled by a validator dynamically if necessary. This is used by the IO infrastructure to determine how to record version. |
version_diff_args |
Optional[List[str]]
|
None. Provide arguments to git diff if using a diff as part of the versioning strategy. This is used by the IO infrastructure to determine how to record version. |
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 |
ThirdPartyTask-specific |
Optional[str]
|
|
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/parameters.py
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 224 225 226 227 228 229 230 | |
TemplateConfig
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/parameters.py
278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 | |
TemplateParameters
dataclass
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/parameters.py
259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 | |
construct_task_parameters(schema, values)
Construct a TaskParameters object from a schema and parameter values.
This function will create a new TaskParameters object from a pydantic schema
(usually retrieved from the database). This is a simplified container defined in
this module, rather than the pydantic version. This allows its use in environments
which do not have pydantic installed.
This function will recursively construct necessary internal objects as well, e.g.,
AnalysisHeader, TemplateParameters, etc.
This function assumes that the values passed in have been validated, and
that they conform to the schema. No validation will be done.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
schema
|
Dict[str, Any]
|
The JSON schema for the PYDANTIC TaskParameters model. Usually this will be retrieved from the database. |
required |
values
|
Dict[str, Any]
|
The of the parameters for the TaskParameters object. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
new_obj |
object
|
Usually this will be the |
Source code in lute/io/parameters.py
312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 | |
handle_field_attrs(self, *args, **kwargs)
Source code in lute/io/parameters.py
106 107 108 109 110 | |