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

map-viewer widget #13

Merged
merged 13 commits into from
Sep 3, 2024
Merged

map-viewer widget #13

merged 13 commits into from
Sep 3, 2024

Conversation

CBiasuzzi
Copy link
Contributor

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

Does this PR already have an issue describing the problem?

What kind of change does this PR introduce?

feature

What is the current behavior?

What is the new behavior (if this is a feature change)?

adds a map viewer widget to the set. The component used to display the map comes from the powsybl-diagram-viewer library, as well.

Does this PR introduce a breaking change or deprecate an API?

  • Yes
  • No

If yes, please check if the following requirements are fulfilled

  • The Breaking Change or Deprecated label has been added
  • The migration steps are described in the following section

What changes might users need to make in their application due to this PR? (migration steps)

Other information:

CBiasuzzi added 10 commits June 6, 2024 17:21
…rom powsybl-diagram-viewer)

Signed-off-by: Christian Biasuzzi <christian.biasuzzi@soft.it>
…t; adds a widget callback mechanism so that it is possible to intercept picked VL from python; fixes the map demo notebook

Signed-off-by: Christian Biasuzzi <christian.biasuzzi@soft.it>
…ine positions extensions from the network when displaying lines (optional feature)

Signed-off-by: Christian Biasuzzi <christian.biasuzzi@soft.it>
…inal vls in the map widget; network explorer: activates the SLD tab when a VL level is chosen in the map tab

Signed-off-by: Christian Biasuzzi <christian.biasuzzi@soft.it>
Signed-off-by: Christian Biasuzzi <christian.biasuzzi@soft.it>
…te for a line are missing

Signed-off-by: Christian Biasuzzi <christian.biasuzzi@soft.it>
Signed-off-by: Christian Biasuzzi <christian.biasuzzi@soft.it>
Signed-off-by: Christian Biasuzzi <christian.biasuzzi@soft.it>
@CBiasuzzi CBiasuzzi changed the title [WIP] map-viewer widget map-viewer widget Jul 26, 2024
Signed-off-by: Florian Dupuy <florian.dupuy@rte-france.com>
src/pypowsybl_jupyter/networkmapwidget.py Outdated Show resolved Hide resolved
src/pypowsybl_jupyter/networkmapwidget.py Outdated Show resolved Hide resolved
src/pypowsybl_jupyter/networkmapwidget.py Outdated Show resolved Hide resolved
src/pypowsybl_jupyter/networkmapwidget.py Show resolved Hide resolved

def extract_nominal_voltage_list(self, network, nvls_top_tiers):
nvls_filtered = []
nvls_filtered = sorted(network.get_voltage_levels()['nominal_v'].unique(), reverse=True)
Copy link
Contributor

@flo-dup flo-dup Sep 3, 2024

Choose a reason for hiding this comment

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

ok for now, but we might need to change this as in some (huge) network there are more than 50 unique nominal voltages. I'll see with GridSuite how (and if!) they deal with this kind of problems.

js/voltage-level-choice.jsx Show resolved Hide resolved

![network-explorer MAP tab](/_static/img/network_explorer_3.png)

The 'Network map' displays the network's substations and lines on a map. The map is empty if the network does not contain geo data.
Copy link
Contributor

Choose a reason for hiding this comment

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

The map is empty but centered and zoomed on latitude 0, longitude 0, which is strange. It would be better to have the map unzoomed to see the whole world. Or not to load the map viewer widget, replacing it with a text "No geodata found"? what do you think?

src/pypowsybl_jupyter/networkmapwidget.py Outdated Show resolved Hide resolved
src/pypowsybl_jupyter/networkexplorer.py Outdated Show resolved Hide resolved
def go_to_vl_from_map(event: any):
vl_from_map= str(event.selected_vl)
set_current_vl(vl_from_map)
#switch to the SLD tab
Copy link
Contributor

Choose a reason for hiding this comment

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

I realized that the switch might be really slow if the NAD-depth is high. This is not due to this PR (also occurs when navigating with arrows on SLD) so I'll open a new issue about that

Signed-off-by: Christian Biasuzzi <christian.biasuzzi@soft.it>
…data parameter to the explorer

Signed-off-by: Christian Biasuzzi <christian.biasuzzi@soft.it>
@flo-dup flo-dup merged commit f5cbcb4 into main Sep 3, 2024
4 checks passed
@flo-dup flo-dup deleted the mapviewer_widget branch September 9, 2024 08:01
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.

2 participants