Skip to content

Conversation

@llucax
Copy link
Contributor

@llucax llucax commented Mar 7, 2024

Unfortunately we can't remove the direct dependency on frequenz-api-microgrid yet because some code is still using the raw protobuf structures, as there are no wrappers for them yet (neither in the internal code nor in frequenz-client-microgrid, which is based on the SDK code).

Fixes #853.

llucax added 8 commits March 7, 2024 13:49
We'll start to use the new external microgrid client instead of the
internal one.

Signed-off-by: Leandro Lucarella <[email protected]>
The `Connection` type in the external microgrid API is a dataclass
instead of a tuple, so we need to convert it when a tuple is expected.

Signed-off-by: Leandro Lucarella <[email protected]>
In the tests we are sometimes mocking the client, so we need to use the
client `Fuse` type instead of our internal `Fuse` type (that uses
quantities).

Signed-off-by: Leandro Lucarella <[email protected]>
To avoid circular dependencies, it is always better to import symbols
from the leaf module internally.

Signed-off-by: Leandro Lucarella <[email protected]>
Since now we have an internal `Fuse` type that uses quantities to avoid
bugs, we need to make sure to properly convert between the client's
`Fuse` type and the internal one.

There is also actually a bug in the old code, as the conversion to
`Current` never happened. This was never caught by `mypy` because we
were using the `**args` syntax to create the object, so there is no
type checking of the arguments, so a bad `Fuse` was being created, with
a `float` `max_current` instead of using `Current`.

We now make sure the conversion is done appropriately.

Signed-off-by: Leandro Lucarella <[email protected]>
Signed-off-by: Leandro Lucarella <[email protected]>
Since we are now using an external microgrid client, it is better to
mock the location more shallowly, avoiding any timezone lookups
completely.

Signed-off-by: Leandro Lucarella <[email protected]>
@llucax llucax requested a review from a team as a code owner March 7, 2024 14:12
@llucax llucax requested a review from Marenz March 7, 2024 14:13
@github-actions github-actions bot added part:docs Affects the documentation part:tests Affects the unit, integration and performance (benchmarks) tests part:tooling Affects the development tooling (CI, deployment, dependency management, etc.) part:data-pipeline Affects the data pipeline part:actor Affects an actor ot the actors utilities (decorator, etc.) part:microgrid Affects the interactions with the microgrid labels Mar 7, 2024
@llucax llucax added this to the v1.0.0-rc6 milestone Mar 7, 2024
@llucax llucax self-assigned this Mar 7, 2024
@llucax llucax requested a review from shsms March 7, 2024 14:14
llucax added 3 commits March 7, 2024 15:23
Signed-off-by: Leandro Lucarella <[email protected]>
Signed-off-by: Leandro Lucarella <[email protected]>
@shsms
Copy link
Contributor

shsms commented Mar 11, 2024

This looks good, I will take it in now, so that I can make progress on the channel update.

@shsms shsms added this pull request to the merge queue Mar 11, 2024
Merged via the queue into frequenz-floss:v1.x.x with commit c7a58e1 Mar 11, 2024
@llucax llucax deleted the ugrid-api branch March 28, 2024 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

part:actor Affects an actor ot the actors utilities (decorator, etc.) part:data-pipeline Affects the data pipeline part:docs Affects the documentation part:microgrid Affects the interactions with the microgrid part:tests Affects the unit, integration and performance (benchmarks) tests part:tooling Affects the development tooling (CI, deployment, dependency management, etc.)

Projects

Development

Successfully merging this pull request may close these issues.

Split out the microgrid.client to its own repository

2 participants