-
Notifications
You must be signed in to change notification settings - Fork 20
Store the original Component and Connection in the component graph
#1093
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
82d3016 to
35a4a80
Compare
Component and Connection in the component graph
|
Skipping release notes as it is invisible to the user. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a few minor comments to check for. LGTM otherwise
|
IIUC this PR is fixing #789. If that's the case, it should be mentioned in the PR description |
For some reason the Component and Connection objects were converted to `dict` to store them in the component graph. This requires re-building the objects when they need to be extracted, which is wasteful. It also means that type information is lost, and in the future, when adopting the microgrid API client using v0.17, we have a class hierarchy for components instead of relaying in the category and type, so we would even need to store the type if we wanted to rebuild the objects. Having nested objects is also an issue, as then the nested properties were kept as `dict`, adding an inconsistency and making it type-unsafe. With this change we are able to get rid of a hack to retrieve the grid metadata. Signed-off-by: Leandro Lucarella <[email protected]>
Signed-off-by: Leandro Lucarella <[email protected]>
There is plenty we can still do without the metadata, so completely disabling access to the grid connection point if we don't have metadata is too strict. Signed-off-by: Leandro Lucarella <[email protected]>
Signed-off-by: Leandro Lucarella <[email protected]>
Co-authored-by: Daniel Zullo <[email protected]> Signed-off-by: Leandro Lucarella <[email protected]>
35a4a80 to
90e2131
Compare
|
Updated with the suggested fixes. |
daniel-zullo-frequenz
approved these changes
Nov 4, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
cmd:skip-release-notes
It is not necessary to update release notes for this PR
part:data-pipeline
Affects the data pipeline
part:microgrid
Affects the interactions with the microgrid
part:tests
Affects the unit, integration and performance (benchmarks) tests
type:tech-debt
Improves the project without visible changes for users
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For some reason the Component and Connection objects were converted to
dictto store them in the component graph. This requires re-building the objects when they need to be extracted, which is wasteful.It also means that type information is lost, and in the future, when adopting the microgrid API client using v0.17, we have a class hierarchy for components instead of relaying in the category and type, so we would even need to store the type if we wanted to rebuild the objects.
Having nested objects is also an issue, as then the nested properties were kept as
dict, adding an inconsistency and making it type-unsafe.With this change we are able to get rid of a hack to retrieve the grid metadata.
Fixes #789.