Controlling cyclers¶
Copyright © 2025-2026, Empa.
server_manager manages a database and communicates with multiple cycler servers.
This module defines a ServerManager class. The ServerManager object communicates with multiple CyclerServer objects defined in cycler_servers, and manages the database of samples, pipelines and jobs.
Server manager takes functions like load, submit, snapshot, update etc. sends commands to the appropriate server, and handles the database updates.
ServerManager
¶
The ServerManager class manages the cycling servers.
Source code in aurora_cycler_manager/server_manager.py
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 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 | |
servers
cached
property
¶
Get a dictionary of Cycler Servers.
__init__()
¶
Initialize the server manager object.
Source code in aurora_cycler_manager/server_manager.py
cancel(jobid)
¶
Cancel a job on a server.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
jobid
|
str
|
str The job ID to cancel, must exist in jobs table of database |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
None
|
The output from the server cancel command |
Source code in aurora_cycler_manager/server_manager.py
eject(pipeline_id, sample_id=None)
¶
Eject a sample from a pipeline.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
pipeline_id
|
str
|
The pipeline to eject the sample from, must exist in pipelines table of database |
required |
sample_id
|
str
|
Check that this sample is on the pipeline before ejecting |
None
|
Source code in aurora_cycler_manager/server_manager.py
load(pipeline_id, sample_id)
¶
Load a sample on a pipeline.
The appropriate server is found based on the pipeline, and the sample is loaded.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sample_id
|
str
|
The sample ID to load. Must exist in samples table of database |
required |
pipeline_id
|
str
|
The pipeline to load the sample on. Must exist in pipelines table of database |
required |
Source code in aurora_cycler_manager/server_manager.py
snapshot(samp_or_jobid, mode='new_data')
¶
Snapshot sample or job, download data, process, and save.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
samp_or_jobid
|
str
|
str The sample ID or (aurora) job ID to snapshot. |
required |
mode
|
Literal['always', 'new_data', 'if_not_exists']
|
str, optional When to make a new snapshot. Can be one of the following: - 'always': Force a snapshot even if job is already done and data is downloaded. - 'new_data': Snapshot if there is new data. - 'if_not_exists': Snapshot only if the file doesn't exist locally. Default is 'new_data'. |
'new_data'
|
Source code in aurora_cycler_manager/server_manager.py
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 | |
submit(sample_id, payload, capacity_Ah, comment='')
¶
Submit a job to a server.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sample_id
|
str
|
str The sample ID to submit the job for, must exist in samples table of database |
required |
payload
|
str | Path | dict
|
str or Path or dict Preferably an aurora-unicycler dictionary - this is auto-converted to the right format for each cycler In addition, different cyclers can accept different payload formats (Neware) A .xml path or xml string with a Neware protocol (Biologic) A .mps path or mps string with a Biologic protocol |
required |
capacity_Ah
|
float | Literal['areal', 'mass', 'nominal']
|
float or str The capacity of the sample in Ah, if 'areal', 'mass', or 'nominal', the capacity is calculated from the sample information |
required |
comment
|
str
|
str, optional A comment to add to the job in the database |
''
|
Source code in aurora_cycler_manager/server_manager.py
update_db()
¶
Query all cycler servers and update the pipelines table in the database with their current status.
Source code in aurora_cycler_manager/server_manager.py
find_server(label)
¶
Get the server object from the label.