Skip to content
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

fix which repairs set_line_geodata if the net doesn't have geodata fo… #2123

Open
wants to merge 10 commits into
base: develop
Choose a base branch
from

Conversation

vogt31337
Copy link
Contributor

Hi,

currently if you have a somewhat broken grid, which doesn't have geodata for all lines, you can take this function and "create" line data from the connecting nodes. But if not all nodes are having geodata, this function breaks.

This fix will now calculate a mean replacement coordinate (if the user wants it) and sets this replacement into all nodes without geodata. Therefore the grid will have many lines connecting to the center, but It's better than nothing...

BR

@codecov
Copy link

codecov bot commented Sep 4, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.44%. Comparing base (f2794c6) to head (23d1f86).
Report is 45 commits behind head on develop.

Current head 23d1f86 differs from pull request most recent head 0514ac9

Please upload reports for the commit 0514ac9 to get more accurate results.

Additional details and impacted files
@@             Coverage Diff              @@
##           develop    #2123       +/-   ##
============================================
+ Coverage    62.30%   79.44%   +17.14%     
============================================
  Files          255      255               
  Lines        28062    27951      -111     
============================================
+ Hits         17483    22205     +4722     
+ Misses       10579     5746     -4833     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rbolgaryn
Copy link
Member

please add a changelog mention

Copy link
Member

@rbolgaryn rbolgaryn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add a mention in changelog

@SteffenMeinecke SteffenMeinecke dismissed rbolgaryn’s stale review November 29, 2023 10:45

the changelog has been adapted

@rbolgaryn
Copy link
Member

tutorial tests are failing:

grafik

Can it have anything to do with the changes in this PR?

…eature/repaired_set_line_geodata

AND
plotting_toolbox revision and testing
@SteffenMeinecke
Copy link
Member

@vogt31337 @KS-HTK I fixed this PR. Can you please merge?

@@ -498,7 +498,8 @@ def _get_coords_from_geojson(gj_str):
return ast.literal_eval(m)
return None

if use_bus_geodata is False and line_geodata is None and ("geo" not in net.line.columns or net.line.geo.empty):
if use_bus_geodata is False and line_geodata is None and (
"geo" not in net.line.columns or net.line.geo.empty):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

net.line.geo.empty is only true if net.line.empty is true, since it the geo column contains every row of the net.line table even if no value is given. A check if no geo values are present should be done using net.line.geo.dropna().empty or similarly (see also plotting_toolbox.py:210 it uses net.bus.geo.isnull().all()).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants