Skip to content

Add problematic electrical component connections hierarchy#235

Merged
llucax merged 7 commits into
frequenz-floss:v0.x.xfrom
llucax:problematic-connection
Jul 7, 2026
Merged

Add problematic electrical component connections hierarchy#235
llucax merged 7 commits into
frequenz-floss:v0.x.xfrom
llucax:problematic-connection

Conversation

@llucax

@llucax llucax commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

This PR brings the electrical component connection closer to the electrical component class hierarchy, adding problematic electrical component connections and a base class.

With this clients have full control over what is received from the API, having the change to act on problematic connections instead of them being implicitly dropped.

@llucax llucax requested a review from a team as a code owner July 3, 2026 14:10
@llucax llucax requested review from daniel-zullo-frequenz and removed request for a team July 3, 2026 14:10
@llucax llucax added this to the v0.4.1 milestone Jul 3, 2026
@github-actions github-actions Bot added part:docs Affects the documentation part:tests Affects the unit, integration and performance (benchmarks) tests part:microgrid Affects the microgrid protobuf definitions labels Jul 3, 2026
@llucax llucax self-assigned this Jul 3, 2026
@llucax llucax enabled auto-merge July 3, 2026 14:11
@llucax llucax force-pushed the problematic-connection branch 4 times, most recently from f7cfdb8 to c0a030c Compare July 6, 2026 12:10
llucax added 5 commits July 6, 2026 17:20
This is a new abstract base class that will be used to mirror the
`ElectricalComponent` class hierarchy.

Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Added a new `ProblematicElectricalComponentConnection` class hierarchy.

For now only one sub-class is provided:
`SelfReferencingElectricalComponentConnection`, where the `source` and
`destination` point to the same ID.

Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Added a new `ProblematicElectricalComponentConnectionTypes` and
`ElectricalComponentConnectionTypes` type aliases to mirror the type
aliases available for electrical components.

Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Update `electrical_component_connection_from_proto()` to return
`ElectricalComponentConnectionTypes`, instantiating a
`SelfReferencingElectricalComponentConnection` when a self referencing
connection is detected instead of returning `None`, mirroring what we
do for electrical components.

Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
@llucax llucax force-pushed the problematic-connection branch from c0a030c to 23a6cf6 Compare July 6, 2026 15:20

@daniel-zullo-frequenz daniel-zullo-frequenz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, I only found a couple of cosmetics in the new files copyright header

Comment thread tests/microgrid/electrical_components/test_problematic_connection.py Outdated
llucax and others added 2 commits July 7, 2026 15:21
Co-authored-by: daniel-zullo-frequenz <120166726+daniel-zullo-frequenz@users.noreply.github.com>
Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
Co-authored-by: daniel-zullo-frequenz <120166726+daniel-zullo-frequenz@users.noreply.github.com>
Signed-off-by: Leandro Lucarella <luca-frequenz@llucax.com>
@llucax llucax added this pull request to the merge queue Jul 7, 2026
Merged via the queue into frequenz-floss:v0.x.x with commit 265323e Jul 7, 2026
9 checks passed
@llucax llucax deleted the problematic-connection branch July 7, 2026 13:25
@llucax

llucax commented Jul 7, 2026

Copy link
Copy Markdown
Contributor Author

Oh, damn, I wanted to squash the commits :P

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

part:docs Affects the documentation part:microgrid Affects the microgrid protobuf definitions part:tests Affects the unit, integration and performance (benchmarks) tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants