-
Notifications
You must be signed in to change notification settings - Fork 438
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
Add network function #781
Add network function #781
Conversation
function to add the components of one network to another
for more information, see https://pre-commit.ci
Bug fixes and added unit test for adding a network with only bus components to another network. More tests needed.
added description of new method to release file
b1f38c3
to
b96d7ac
Compare
for more information, see https://pre-commit.ci
updated test functionality to take base network as input
0d4d69f
to
2d7c749
Compare
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #781 +/- ##
===========================================
+ Coverage 66.26% 78.78% +12.51%
===========================================
Files 26 26
Lines 7066 7116 +50
Branches 1418 1567 +149
===========================================
+ Hits 4682 5606 +924
+ Misses 2102 1185 -917
- Partials 282 325 +43 ☔ View full report in Codecov by Sentry. |
Updated method to include additional inputs suggested by Fabian and error thrown if snapshots/snapshot weightings in the networks do not agree. Also added warning if components with IDs matching component in existing network are added - this warning does not apply to components of type LineType or TransformerType but duplicate components will still not be added in this case. Updated static test to reflect these changes and added new tests for the case where the method returns a new network (inplace=false), and the case where time-varying data is added (with_time=True_
for more information, see https://pre-commit.ci
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.
before reviewing, I was thinking about a better naming. Perhaps import_from_network
would be better aligning with the other import function names?
how about "add_components_from_network"? Could also change the current add function in components.py to "add_component" so that the distinction is clear? |
sounds good
which function do you mean exactly? I would not touch existing ones though... |
okay great I'll do that :-)
fair point |
renamed add_network function to add_components_from_network also moved function to follow existing add function (for adding single components) updated tests to match function rename
for more information, see https://pre-commit.ci
@FabianHofmann what's the reason for the failing tests? I can't work it out from the output |
I have no clue, I retriggered them |
@FabianHofmann can this now be merged? |
Hey @jessLryan, I will review as soon as I have time. This will likely take some time. |
@FabianHofmann I've come across a bug: we need to change the method so that buses are added first (otherwise new components e.g. lines, which are attached to the new buses will fail to be added due to a check at Line 914 of io.py). I'll update and commit |
need to add buses before other components due to existing check in import_components_from_dataframe method when adding components with "bus" in component dataframe columns (components must not be associated with a bus which is not already present in the network)
for more information, see https://pre-commit.ci
now fixed |
Closes #506
Changes proposed in this Pull Request
Checklist
doc
.environment.yaml
,environment_docs.yaml
andsetup.py
(if applicable).doc/release_notes.rst
of the upcoming release is included.