-
Notifications
You must be signed in to change notification settings - Fork 484
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
Feature/additional patches #2114
base: develop
Are you sure you want to change the base?
Conversation
hzraja
commented
Aug 16, 2023
- Added patch for the Wind turbine
- Added patch for PV
- static alignment for generic patches based on the different patch type at each bus (3 patches -> 120°, 4 patches -> 90°)
- Fix visual Bugs
- Fixed Pandapipes compatibility issue
- Add changes to \pandapower\CHANGELOG.rs
…ersonal_develop
… into personal_develop
…ersonal_develop
…ersonal_develop
… into personal_develop
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #2114 +/- ##
===========================================
- Coverage 79.84% 79.66% -0.18%
===========================================
Files 255 255
Lines 27971 27822 -149
===========================================
- Hits 22333 22164 -169
- Misses 5638 5658 +20 ☔ View full report in Codecov by Sentry. |
@@ -995,18 +998,17 @@ def create_load_collection(net, loads=None, size=1., infofunc=None, orientation= | |||
""" | |||
loads = get_index_array(loads, net.load.index) | |||
infos = [infofunc(i) for i in range(len(loads))] if infofunc is not None else [] | |||
node_coords = net.bus_geodata.loc[net.load.loc[loads, "bus"].values, ["x", "y"]].values |
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.
Why are we allowed to remove this statement?
pandapower/plotting/patch_makers.py
Outdated
try: | ||
angle = unique_angles[i]["sgen"]["WT"] + (angles[i] or 0) | ||
except IndexError: | ||
continue |
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.
What would an index error mean? In what case could it occur? I wouldn't necessarily "hide" an exception that is thrown, because it could indicate a wrong implementation somewhere, except we are sure that it is more useful to just not plot some node elements when the angles or unique_angles are not given correctly.
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.
There were some edge cases where angles were not in sync with node_coords so used exceptions, This is removed in the upcoming commit
pandapower/plotting/patch_makers.py
Outdated
lines.append((perp_foot1, line_end1)) | ||
lines.append((perp_foot2, line_end2)) | ||
else: | ||
continue |
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.
Is there any option for plotting without "unique_angles"? To me it looks like there isn't. I also think that defining the type of patch you want to draw via a variable called "unique_angles" is not very transparent. I would prefer some sort of "type" lookup that defines the type of patch used for each sgen and its angle. If it is not given for any of the indices, that sgen has the default patch.
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.
Added option to work without unique_angles in the upcoming commit.
pandapower/plotting/simple_plot.py
Outdated
gen_count = 0 | ||
load_count = 0 | ||
if plot_sgens and len(net.sgen): | ||
sgen_types_counts = net.sgen[net.sgen.bus == i].type.value_counts() |
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.
To me this is a lot of hard coded and rather implicit indication of the patch types drawn for a simple_plot. I am not too sure how users would react to that. I could agree on this, because it is "just" simple_plot, but in the dedicated plotting functions, we need room for adaptions by the user.
I like the idea of having new patches for wind turbines and PV plants, but I doubt that the implementation does exactly what it is supposed to do. A few aspects that I would like to clarify:
|
…eature/additional_patches
…o feature/additional_patches Seperate implementation for simple_plot & collections
* PeP8 max line length
Looks nice, but please resolve the conflicts and add an entry to the changelog. @hzraja @jwiemer112 |