config
Machinary for the IO of configuration YAML files and their validation.
Functions:
Name | Description |
---|---|
parse_config |
str, config_path: str) -> TaskParameters: Parse a configuration file and return a TaskParameters object of validated parameters for a specific Task. Raises an exception if the provided configuration does not match the expected model. |
Raises:
Type | Description |
---|---|
ValidationError
|
Error raised by pydantic during data validation. (From Pydantic) |
AnalysisHeader
Bases: BaseModel
Header information for LUTE analysis runs.
Source code in lute/io/models/base.py
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 |
|
AnalyzeSmallDataXASParameters
Bases: TaskParameters
TaskParameter model for AnalyzeSmallDataXAS Task.
This Task does basic analysis of XAS data based on a SmallData HDF5 output file. It calculates difference absorption and signal binned by various scanned motors.
Source code in lute/io/models/smd.py
490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 |
|
AnalyzeSmallDataXESParameters
Bases: TaskParameters
TaskParameter model for AnalyzeSmallDataXES Task.
This Task does basic analysis of XES data based on a SmallData HDF5 output file. It calculates difference emission and signal binned by various scanned motors.
Source code in lute/io/models/smd.py
539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 |
|
AnalyzeSmallDataXSSParameters
Bases: TaskParameters
TaskParameter model for AnalyzeSmallDataXSS Task.
This Task does basic analysis of XSS data based on a SmallData HDF5 output file. It calculates difference scattering and signal binned by various scanned motors.
Source code in lute/io/models/smd.py
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 |
|
CompareHKLParameters
Bases: ThirdPartyParameters
Parameters for CrystFEL's compare_hkl
for calculating figures of merit.
There are many parameters, and many combinations. For more information on usage, please refer to the CrystFEL documentation, here: https://www.desy.de/~twhite/crystfel/manual-partialator.html
Source code in lute/io/models/sfx_merge.py
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 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 |
|
Config
Bases: Config
Source code in lute/io/models/sfx_merge.py
389 390 391 392 393 394 |
|
long_flags_use_eq: bool = True
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.
ConcatenateStreamFilesParameters
Bases: TaskParameters
Parameters for stream concatenation.
Concatenates the stream file output from CrystFEL indexing for multiple experimental runs.
Source code in lute/io/models/sfx_index.py
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 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 |
|
Config
Bases: Config
Source code in lute/io/models/sfx_index.py
460 461 462 |
|
set_result: bool = True
class-attribute
instance-attribute
Whether the Executor should mark a specified parameter as a result.
DimpleSolveParameters
Bases: ThirdPartyParameters
Parameters for CCP4's dimple program.
There are many parameters. For more information on usage, please refer to the CCP4 documentation, here: https://ccp4.github.io/dimple/
Source code in lute/io/models/sfx_solve.py
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 |
|
Config
Bases: Config
Identical to super-class Config but includes a result.
Source code in lute/io/models/sfx_solve.py
28 29 30 31 32 33 34 35 |
|
result_from_params: str = ''
class-attribute
instance-attribute
Defines a result from the parameters. Use a validator to do so.
set_result: bool = True
class-attribute
instance-attribute
Whether the Executor should mark a specified parameter as a result.
FindPeaksPsocakeParameters
Bases: ThirdPartyParameters
Parameters for crystallographic (Bragg) peak finding using Psocake.
This peak finding Task optionally has the ability to compress/decompress data with SZ for the purpose of compression validation. NOTE: This Task is deprecated and provided for compatibility only.
Source code in lute/io/models/sfx_find_peaks.py
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 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 311 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 |
|
Config
Bases: Config
Source code in lute/io/models/sfx_find_peaks.py
145 146 147 148 149 150 |
|
result_from_params: str = ''
class-attribute
instance-attribute
Defines a result from the parameters. Use a validator to do so.
set_result: bool = True
class-attribute
instance-attribute
Whether the Executor should mark a specified parameter as a result.
FindPeaksPyAlgosParameters
Bases: TaskParameters
Parameters for crystallographic (Bragg) peak finding using PyAlgos.
This peak finding Task optionally has the ability to compress/decompress data with SZ for the purpose of compression validation.
Source code in lute/io/models/sfx_find_peaks.py
10 11 12 13 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 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 |
|
Config
Bases: Config
Source code in lute/io/models/sfx_find_peaks.py
17 18 19 |
|
set_result: bool = True
class-attribute
instance-attribute
Whether the Executor should mark a specified parameter as a result.
IndexCCTBXXFELParameters
Bases: ThirdPartyParameters
Parameters for indexing with cctbx.xfel.
Source code in lute/io/models/sfx_index.py
510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 |
|
Config
Bases: Config
Source code in lute/io/models/sfx_index.py
513 514 515 |
|
set_result: bool = False
class-attribute
instance-attribute
Whether the Executor should mark a specified parameter as a result.
PhilParameters
Bases: BaseModel
Template parameters for CCTBX phil file.
Source code in lute/io/models/sfx_index.py
517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 |
|
IndexCrystFELParameters
Bases: ThirdPartyParameters
Parameters for CrystFEL's indexamajig
.
There are many parameters, and many combinations. For more information on usage, please refer to the CrystFEL documentation, here: https://www.desy.de/~twhite/crystfel/manual-indexamajig.html
Source code in lute/io/models/sfx_index.py
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 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 311 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 |
|
Config
Bases: Config
Source code in lute/io/models/sfx_index.py
43 44 45 46 47 48 |
|
long_flags_use_eq: bool = True
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.
ManipulateHKLParameters
Bases: ThirdPartyParameters
Parameters for CrystFEL's get_hkl
for manipulating lists of reflections.
This Task is predominantly used internally to convert hkl
to mtz
files.
Note that performing multiple manipulations is undefined behaviour. Run
the Task with multiple configurations in explicit separate steps. For more
information on usage, please refer to the CrystFEL documentation, here:
https://www.desy.de/~twhite/crystfel/manual-partialator.html
Source code in lute/io/models/sfx_merge.py
514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 |
|
Config
Bases: Config
Source code in lute/io/models/sfx_merge.py
524 525 526 527 528 529 |
|
long_flags_use_eq: bool = True
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.
MergeCCTBXXFELParameters
Bases: ThirdPartyParameters
Parameters for merging with cctbx.xfel.
Source code in lute/io/models/sfx_merge.py
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 311 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 |
|
Config
Bases: Config
Source code in lute/io/models/sfx_merge.py
222 223 224 |
|
set_result: bool = False
class-attribute
instance-attribute
Whether the Executor should mark a specified parameter as a result.
PhilParameters
Bases: BaseModel
Template parameters for CCTBX phil file.
Source code in lute/io/models/sfx_merge.py
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 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 |
|
MergePartialatorParameters
Bases: ThirdPartyParameters
Parameters for CrystFEL's partialator
.
There are many parameters, and many combinations. For more information on usage, please refer to the CrystFEL documentation, here: https://www.desy.de/~twhite/crystfel/manual-partialator.html
Source code in lute/io/models/sfx_merge.py
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 |
|
Config
Bases: Config
Source code in lute/io/models/sfx_merge.py
41 42 43 44 45 46 |
|
long_flags_use_eq: bool = True
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.
OptimizeAgBhGeometryExhaustiveParameters
Bases: TaskParameters
TaskParameter model for OptimizeAgBhGeometryExhaustive Task.
This Task does geometry optimization of detector distance and beam center based on a powder image produced from acquiring a run of Ag Behenate.
Source code in lute/io/models/geometry.py
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 |
|
RunSHELXCParameters
Bases: ThirdPartyParameters
Parameters for CCP4's SHELXC program.
SHELXC prepares files for SHELXD and SHELXE.
For more information please refer to the official documentation: https://www.ccp4.ac.uk/html/crank.html
Source code in lute/io/models/sfx_solve.py
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 |
|
SubmitSMDParameters
Bases: ThirdPartyParameters
Parameters for running smalldata to produce reduced HDF5 files.
Source code in lute/io/models/smd.py
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 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 311 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 |
|
Config
Bases: Config
Identical to super-class Config but includes a result.
Source code in lute/io/models/smd.py
49 50 51 52 53 54 55 56 |
|
result_from_params: str = ''
class-attribute
instance-attribute
Defines a result from the parameters. Use a validator to do so.
set_result: bool = True
class-attribute
instance-attribute
Whether the Executor should mark a specified parameter as a result.
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
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 |
|
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
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 |
|
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
317 318 319 320 321 322 323 324 325 326 327 328 329 |
|
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
189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 |
|
TestBinaryErrParameters
Bases: ThirdPartyParameters
Same as TestBinary, but exits with non-zero code.
Source code in lute/io/models/tests.py
71 72 73 74 75 76 77 78 |
|
TestMultiNodeCommunicationParameters
Bases: TaskParameters
Parameters for the test Task TestMultiNodeCommunication
.
Test verifies communication across multiple machines.
Source code in lute/io/models/mpi_tests.py
38 39 40 41 42 43 44 45 46 47 48 49 |
|
TestParameters
Bases: TaskParameters
Parameters for the test Task Test
.
Source code in lute/io/models/tests.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
|
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
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 311 312 313 314 |
|
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
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 |
|
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
.
_check_str_numeric(string)
Check if a string is an integer or float and return it as such.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
string
|
str
|
Input string to check. |
required |
Returns:
Name | Type | Description |
---|---|---|
output |
str | int | float
|
Returns an int or float if the string can be converted to one. Otherwise returns the original string. |
Source code in lute/io/config.py
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
|
parse_config(task_name='test', config_path='')
Parse a configuration file and validate the contents.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
task_name
|
str
|
Name of the specific task that will be run. |
'test'
|
config_path
|
str
|
Path to the configuration file. |
''
|
Returns:
Name | Type | Description |
---|---|---|
params |
TaskParameters
|
A TaskParameters object of validated
task-specific parameters. Parameters are accessed with "dot"
notation. E.g. |
Raises:
Type | Description |
---|---|
ValidationError
|
Raised if there are problems with the configuration file. Passed through from Pydantic. |
Source code in lute/io/config.py
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 |
|
substitute_variables(header, config, curr_key=None)
Performs variable substitutions on a dictionary read from config YAML file.
Can be used to define input parameters in terms of other input parameters.
This is similar to functionality employed by validators for parameters in
the specific Task models, but is intended to be more accessible to users.
Variable substitutions are defined using a minimal syntax from Jinja:
{{ experiment }}
defines a substitution of the variable experiment
. The characters {{ }}
can be escaped if the literal symbols are needed in place.
For example, a path to a file can be defined in terms of experiment and run values in the config file: MyTask: experiment: myexp run: 2 special_file: /path/to/{{ experiment }}/{{ run }}/file.inp
Acceptable variables for substitutions are values defined elsewhere in the
YAML file. Environment variables can also be used if prefaced with a $
character. E.g. to get the experiment from an environment variable:
MyTask:
run: 2
special_file: /path/to/{{ $EXPERIMENT }}/{{ run }}/file.inp
Parameters:
Name | Type | Description | Default |
---|---|---|---|
config
|
Dict[str, Any]
|
A dictionary of parsed configuration. |
required |
curr_key
|
Optional[str]
|
Used to keep track of recursion level when scanning through iterable items in the config dictionary. |
None
|
Returns:
Name | Type | Description |
---|---|---|
subbed_config |
Dict[str, Any]
|
The config dictionary after substitutions have been made. May be identical to the input if no substitutions are needed. |
Source code in lute/io/config.py
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 |
|