openg2g.types¶
openg2g.types
¶
Cross-cutting types shared across component families.
ThreePhase
dataclass
¶
Three-phase quantity. Access via .a, .b, .c.
Source code in openg2g/types.py
total()
¶
TapPosition
dataclass
¶
Regulator tap position per phase, as per-unit tap ratios.
Each field is the tap ratio for the corresponding phase regulator.
Phases set to None are left unchanged when applied. At least
one phase must be specified.
Combine with at() and | to build a TapSchedule:
TAP_STEP = 0.00625 # standard 5/8% tap step
schedule = (
TapPosition(a=1.0 + 14 * TAP_STEP, b=1.0 + 6 * TAP_STEP, c=1.0 + 15 * TAP_STEP).at(t=0)
| TapPosition(a=1.1).at(t=1500)
| TapPosition(a=1.0625, c=1.0625).at(t=3300)
)
Source code in openg2g/types.py
TapSchedule
¶
Ordered sequence of scheduled tap positions.
Build using TapPosition.at() and the | operator:
TAP_STEP = 0.00625 # standard 5/8% tap step
schedule = (
TapPosition(a=1.0 + 14 * TAP_STEP, b=1.0 + 6 * TAP_STEP, c=1.0 + 15 * TAP_STEP).at(t=0)
| TapPosition(a=1.0 + 16 * TAP_STEP).at(t=25 * 60)
)
Raises:
| Type | Description |
|---|---|
ValueError
|
If two entries share the same timestamp. |
Source code in openg2g/types.py
DatacenterCommand
¶
Base for commands targeting the datacenter backend.
Subclass this for each concrete datacenter command kind. The coordinator routes commands to backends based on this type hierarchy.
GridCommand
¶
Base for commands targeting the grid backend.
Subclass this for each concrete grid command kind. The coordinator routes commands to backends based on this type hierarchy.
SetBatchSize
dataclass
¶
Bases: DatacenterCommand
Set batch sizes for one or more models.
Attributes:
| Name | Type | Description |
|---|---|---|
batch_size_by_model |
dict[str, int]
|
Mapping of model label to target batch size. |
ramp_up_rate_by_model |
dict[str, float]
|
Per-model requests/second ramp-up rate. Models not present get immediate changes (rate 0). |
Source code in openg2g/types.py
SetTaps
dataclass
¶
Bases: GridCommand
Set regulator tap positions.
Attributes:
| Name | Type | Description |
|---|---|---|
tap_position |
TapPosition
|
Per-phase tap ratios. Phases set to |
Source code in openg2g/types.py
ControlAction
dataclass
¶
Collection of control commands emitted by a controller.
Use an empty commands list for a no-op action.