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

adds a use_name parameter to the network explorer #15

Merged
merged 2 commits into from
Jul 24, 2024
Merged

Conversation

CBiasuzzi
Copy link
Contributor

…display ids or names in the selection list and in the tabs content

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?

no

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 use_name parameter to the network_explorer. If set to True (the default) the explorer displays VLs names in the selection list and in the tabs widgets. When a name is not available, the Id is used.

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:

…isplay ids or names in the selection list and in the tabs content

Signed-off-by: Christian Biasuzzi <christian.biasuzzi@soft.it>
@CBiasuzzi CBiasuzzi requested a review from flo-dup July 3, 2024 15:30
src/pypowsybl_jupyter/selectcontext.py Outdated Show resolved Hide resolved
src/pypowsybl_jupyter/selectcontext.py Outdated Show resolved Hide resolved
Signed-off-by: Christian Biasuzzi <christian.biasuzzi@soft.it>
self.use_name = use_name
self.display_attribute = 'name' if use_name else 'id'

self.vls = network.get_voltage_levels(attributes=['name'])
Copy link
Contributor

Choose a reason for hiding this comment

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

Just thinking about what could be done to display only specific kind of voltage levels, for a coming PR! To do something similar to the javaFX viewer where you could choose to display only voltage levels with specific equipments. That would mean having here a parameter, either a function (a voltage level provider) or a filter. We'll speak about it later!

@flo-dup flo-dup merged commit ef08cac into main Jul 24, 2024
4 checks passed
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