-
Couldn't load subscription status.
- 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
Conversation
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. |
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.