Configurator API¶
pyadm1.configurator.plant_builder.BiogasPlant
¶
Complete biogas plant model with multiple components.
Manages component lifecycle, connections, and simulation. Supports JSON-based configuration.
Attributes:
| Name | Type | Description |
|---|---|---|
plant_name |
str
|
Name of the biogas plant. |
components |
Dict[str, Component]
|
Dictionary of all plant components. |
connections |
List[Connection]
|
List of connections between components. |
simulation_time |
float
|
Current simulation time in days. |
Example
from pyadm1 import Feedstock, BiogasPlant from pyadm1.components.biological import Digester
feedstock = Feedstock(["maize_silage_milk_ripeness", "swine_manure"], feeding_freq=24) plant = BiogasPlant("My Plant") digester = Digester("dig1", feedstock, V_liq=1200, V_gas=216, T_ad=315.15) plant.add_component(digester) plant.initialize()
Source code in pyadm1/configurator/plant_builder.py
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 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 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 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 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 | |
Methods:¶
__init__(plant_name='Biogas Plant')
¶
Initialize biogas plant.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
plant_name
|
str
|
Name of the plant. Defaults to "Biogas Plant". |
'Biogas Plant'
|
Source code in pyadm1/configurator/plant_builder.py
add_component(component)
¶
Add a component to the plant.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
component
|
Component
|
Component to add to the plant. |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If component with same ID already exists. |
Source code in pyadm1/configurator/plant_builder.py
add_connection(connection)
¶
Add a connection between components.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
connection
|
Connection
|
Connection to add. |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If source or target component not found. |
Source code in pyadm1/configurator/plant_builder.py
from_json(filepath, feedstock=None)
classmethod
¶
Load plant configuration from JSON file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filepath
|
str
|
Path to JSON file. |
required |
feedstock
|
Optional[Feedstock]
|
Feedstock object for digesters. Required if plant has digesters. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
BiogasPlant |
BiogasPlant
|
Loaded plant model. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If feedstock is None but plant contains digesters. |
Source code in pyadm1/configurator/plant_builder.py
get_summary()
¶
Get human-readable summary of plant configuration.
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
Summary text with components and connections. |
Source code in pyadm1/configurator/plant_builder.py
initialize()
¶
Initialize all components.
Note: Most components auto-initialize in their constructor. This method is kept for compatibility and to ensure any components that need explicit initialization are handled.
Source code in pyadm1/configurator/plant_builder.py
simulate(duration, dt=1.0 / 24.0, save_interval=None)
¶
Run simulation for specified duration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
duration
|
float
|
Simulation duration in days. |
required |
dt
|
float
|
Time step in days. Defaults to 1 hour (1/24 day). |
1.0 / 24.0
|
save_interval
|
Optional[float]
|
Interval for saving results in days. If None, saves every step. |
None
|
Returns:
| Type | Description |
|---|---|
List[Dict[str, Any]]
|
List[Dict[str, Any]]: Simulation results at each saved time point. Each entry contains 'time' and 'components' with component results. |
Example
results = plant.simulate(duration=30, dt=1/24, save_interval=1.0) print(f"Simulated {len(results)} time points")
Source code in pyadm1/configurator/plant_builder.py
step(dt)
¶
Perform one simulation time step for all components.
This uses a multi-pass execution model: 1. Execute digesters to produce gas → storages 2. Execute CHPs to determine gas demand → storages 3. Execute storages to supply gas → CHPs (re-execute with actual supply) 4. Execute BiogasUpgrading units: re-execute storages with BGAA demand, then re-execute BGAA with actual supply, then re-execute its flare.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dt
|
float
|
Time step in days. |
required |
Returns:
| Type | Description |
|---|---|
Dict[str, Dict[str, Any]]
|
Dict[str, Dict[str, Any]]: Results from all components. |
Source code in pyadm1/configurator/plant_builder.py
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 | |
to_graph()
¶
Build the typed component/connection graph for this plant.
Serializes the plant exactly like the LLM benchmark does (the
components / connections dict produced by to_dict) and
normalizes it into the benchmark Graph data model. The returned
graph has one Node per component (keyed by component id, carrying
its component_type and serialized scalar parameters) and one
Edge per connection (liquid / gas / heat).
Returns:
| Name | Type | Description |
|---|---|---|
Graph |
Graph
|
Graph with |
Source code in pyadm1/configurator/plant_builder.py
to_json(filepath)
¶
Save plant configuration to JSON file.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filepath
|
str
|
Path to JSON file. |
required |
Source code in pyadm1/configurator/plant_builder.py
visualize_graph(output_path=None, dpi=150, title=None)
¶
Render the plant graph (see :meth:to_graph) to a PNG file.
Mirrors the Mermaid flowchart LR style used for the benchmark
dataset: components are drawn as rounded boxes laid out left-to-right by
process depth, liquid connections as solid labelled arrows and gas
connections as dotted labelled arrows (heat as dashed). Unlike the
dataset diagrams, no dataset-specific annotations (obligations,
confidences, reference ids) are shown -- only the plant's own
components and connections.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
output_path
|
Optional[str]
|
Target PNG path. Defaults to
|
None
|
dpi
|
int
|
Resolution of the saved figure. |
150
|
title
|
Optional[str]
|
Figure title. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
Path to the written PNG file. |
Source code in pyadm1/configurator/plant_builder.py
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 788 789 790 791 792 793 794 795 796 797 798 799 800 801 | |
pyadm1.configurator.plant_configurator.PlantConfigurator
¶
High-level configurator for building biogas plants.
Provides convenient methods for adding components with sensible defaults and automatic setup of common configurations (gas storage attached to digesters, flare attached to CHP, etc.).
Source code in pyadm1/configurator/plant_configurator.py
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 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 | |
Methods:¶
__init__(plant, feedstock)
¶
Parameters¶
plant : BiogasPlant Plant instance to configure. feedstock : Feedstock Feedstock used by all digesters added through this configurator.
Source code in pyadm1/configurator/plant_configurator.py
add_bgaa(bgaa_id, capacity_m3h=500.0, ch4_recovery=0.98, ch4_content_in=0.55, ch4_content_out=0.97, name=None)
¶
Add a biogas upgrading unit (Biogasaufbereitungsanlage) to the plant.
Automatically creates and connects an emergency flare downstream of
the BGAA for capacity overflow ({bgaa_id}_flare).
Source code in pyadm1/configurator/plant_configurator.py
add_chp(chp_id, P_el_nom=500.0, eta_el=0.4, eta_th=0.45, name=None)
¶
Add a CHP unit to the plant.
Automatically creates and connects a safety flare downstream of the CHP.
Source code in pyadm1/configurator/plant_configurator.py
add_digester(digester_id, V_liq=1050.0, V_gas=150.0, T_ad=315.15, name=None, Q_substrates=None, k_L_a=None, adm1_state=None, dynamic_volume=False, initial_fill_fraction=1.0, outflow_time_constant=1.0, backend=None)
¶
Add an ADM1da digester to the plant.
The digester's influent DataFrame, density, and steady-state initial
state are wired automatically from the attached :class:Feedstock.
A gas storage is auto-created and connected.
Parameters¶
digester_id : str
Unique identifier for this digester.
V_liq : float
Liquid volume [m³] (default 1050).
V_gas : float
Gas headspace volume [m³] (default 150).
T_ad : float
Operating temperature [K] (default 315.15 = 42 °C).
name : str, optional
Q_substrates : list of float, optional
Substrate feed rates [m³/d], one entry per substrate slot
(up to 10 slots).
k_L_a : float, optional
Override of the gas–liquid mass-transfer coefficient [1/d].
adm1_state : list of float, optional
41-element initial state vector. When supplied, replaces the
auto-built steady-state vector.
dynamic_volume : bool, default False
Enable a dynamic sludge-volume balance
dV/dt = Q_in − Q_out − q_S,loss, with Q_out from an
overflow weir at V_liq. When False, sludge volume stays
constant.
initial_fill_fraction : float, default 1.0
Starting sludge fill as a fraction of V_liq. Only used when
dynamic_volume=True. Set below 1.0 to simulate a partially-
filled startup transient.
outflow_time_constant : float, default 1.0
Overflow-weir time constant τ_out [d]. Only used when
dynamic_volume=True.
backend : str, optional
ADM1 right-hand-side backend, "numpy" (default) or "torch"
(differentiable, same values). None uses the process-wide
default (see :func:pyadm1.set_default_adm1_backend).
Returns¶
(Digester, str) The created digester and a one-line description of how the initial state was determined.
Source code in pyadm1/configurator/plant_configurator.py
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 | |
add_heating(heating_id, target_temperature=308.15, heat_loss_coefficient=0.5, name=None)
¶
Add a heating system to the plant.
Source code in pyadm1/configurator/plant_configurator.py
auto_connect_chp_to_heating(chp_id, heating_id)
¶
auto_connect_digester_to_bgaa(digester_id, bgaa_id)
¶
Connect digester gas storage → BGAA.
Source code in pyadm1/configurator/plant_configurator.py
auto_connect_digester_to_chp(digester_id, chp_id)
¶
Connect digester → gas_storage → chp.
Source code in pyadm1/configurator/plant_configurator.py
connect(from_component, to_component, connection_type='default')
¶
Connect two components.
Source code in pyadm1/configurator/plant_configurator.py
create_single_stage_plant(digester_config=None, chp_config=None, heating_config=None, auto_connect=True)
¶
Create a complete single-stage plant configuration.
Source code in pyadm1/configurator/plant_configurator.py
create_two_stage_plant(hydrolysis_config=None, digester_config=None, chp_config=None, heating_configs=None, auto_connect=True)
¶
Create a two-stage plant: hydrolysis pre-tank → main fermenter.
The hydrolysis stage is just another :class:Digester instance with
a higher temperature and shorter HRT — there is no separate
Hydrolysis class.
Source code in pyadm1/configurator/plant_configurator.py
pyadm1.configurator.connection_manager.ConnectionManager
¶
Manages connections between components in a biogas plant.
The ConnectionManager handles connection validation, dependency resolution, and provides utilities for analyzing component relationships.
Attributes:
| Name | Type | Description |
|---|---|---|
connections |
List[Connection]
|
List of all connections. |
Example
manager = ConnectionManager() manager.add_connection(Connection("dig1", "chp1", "gas")) deps = manager.get_dependencies("chp1") print(deps) # ['dig1']
Source code in pyadm1/configurator/connection_manager.py
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 | |
Methods:¶
__init__()
¶
__len__()
¶
__repr__()
¶
add_connection(connection)
¶
Add a connection to the manager.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
connection
|
Connection
|
Connection to add. |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If connection already exists. |
Source code in pyadm1/configurator/connection_manager.py
clear()
¶
from_dict(config)
classmethod
¶
Create ConnectionManager from dictionary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
Dict[str, Any]
|
Dictionary with 'connections' key. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
ConnectionManager |
ConnectionManager
|
New manager with loaded connections. |
Source code in pyadm1/configurator/connection_manager.py
get_all_connections()
¶
Get all connections.
Returns:
| Type | Description |
|---|---|
List[Connection]
|
List[Connection]: List of all connections. |
get_connected_components(component_id)
¶
Get all components connected to the given component (directly or indirectly).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
component_id
|
str
|
Starting component ID. |
required |
Returns:
| Type | Description |
|---|---|
Set[str]
|
Set[str]: Set of connected component IDs. |
Source code in pyadm1/configurator/connection_manager.py
get_connections_from(component_id)
¶
Get all connections originating from a component.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
component_id
|
str
|
Component ID. |
required |
Returns:
| Type | Description |
|---|---|
List[Connection]
|
List[Connection]: List of outgoing connections. |
Source code in pyadm1/configurator/connection_manager.py
get_connections_to(component_id)
¶
Get all connections terminating at a component.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
component_id
|
str
|
Component ID. |
required |
Returns:
| Type | Description |
|---|---|
List[Connection]
|
List[Connection]: List of incoming connections. |
Source code in pyadm1/configurator/connection_manager.py
get_dependencies(component_id)
¶
Get all components that the given component depends on.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
component_id
|
str
|
Component ID. |
required |
Returns:
| Type | Description |
|---|---|
List[str]
|
List[str]: List of component IDs that this component depends on. |
Source code in pyadm1/configurator/connection_manager.py
get_dependents(component_id)
¶
Get all components that depend on the given component.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
component_id
|
str
|
Component ID. |
required |
Returns:
| Type | Description |
|---|---|
List[str]
|
List[str]: List of component IDs that depend on this component. |
Source code in pyadm1/configurator/connection_manager.py
get_execution_order(component_ids)
¶
Determine execution order based on dependencies (topological sort).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
component_ids
|
List[str]
|
List of all component IDs. |
required |
Returns:
| Type | Description |
|---|---|
List[str]
|
List[str]: Component IDs in execution order. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If circular dependencies are detected. |
Source code in pyadm1/configurator/connection_manager.py
has_circular_dependency(component_ids)
¶
Check if there are circular dependencies.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
component_ids
|
List[str]
|
List of component IDs to check. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if circular dependencies exist, False otherwise. |
Source code in pyadm1/configurator/connection_manager.py
remove_connection(from_component, to_component, connection_type=None)
¶
Remove a connection.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
from_component
|
str
|
Source component ID. |
required |
to_component
|
str
|
Target component ID. |
required |
connection_type
|
Optional[str]
|
Connection type. If None, removes all connections between the components. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
True if at least one connection was removed, False otherwise. |
Source code in pyadm1/configurator/connection_manager.py
to_dict()
¶
Serialize all connections to dictionary.
Returns:
| Type | Description |
|---|---|
Dict[str, Any]
|
Dict[str, Any]: Dictionary with connection data. |
Source code in pyadm1/configurator/connection_manager.py
validate_connections(component_ids)
¶
Validate all connections and return list of issues.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
component_ids
|
List[str]
|
List of valid component IDs. |
required |
Returns:
| Type | Description |
|---|---|
List[str]
|
List[str]: List of validation error messages. Empty if all valid. |