Fix the local import of EnergySystem within nodes.py module#86
Draft
Bachibouzouk wants to merge 4 commits into
Draft
Fix the local import of EnergySystem within nodes.py module#86Bachibouzouk wants to merge 4 commits into
Bachibouzouk wants to merge 4 commits into
Conversation
As now the nodes all have a _energy_system attribute, we can use it to connect `_add_subnodes` to the signal triggered when the node is added to the energy system
Fix associated test
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||||||||||||||
Member
|
I like the general idea. Note that if you allow telling a For the naming, if we agree to add this to the API: Would a more classical property getter/ setter do? (I don't know how that works with signals.) |
Bachibouzouk
commented
May 27, 2026
|
|
||
| self._nodes.update(new_nodes) | ||
| for n in nodes: | ||
| self.signals[type(self).add].send(n, EnergySystem=self) |
Contributor
Author
There was a problem hiding this comment.
@gnn - I am not sure if there was a particular use of adding EnergySystem to the kwargs, I couldn't find any in the code, beside the test
Member
There was a problem hiding this comment.
I think this is because @gnn did not want the Node to have a reference to the EnergySystem.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Add a method
connect_to_energy_systemto the Node class to assign a reference to the EnergySystem when a Node instance is added to it and to connect Node class methods with the signal sent when from the Energysystem when the Node instance is added.